From 9c2af5dcd2d2c8754e4c74e02141822c0964a5a8 Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Thu, 13 Feb 2020 16:30:38 +0100 Subject: moved utility scripts to their dedicated folder --- scripts/.gitignore | 1 + scripts/readme.md | 24 ++++++++++++++++++++ scripts/win_build.cmd | 5 +++++ scripts/win_compile_example.cmd | 10 +++++++++ scripts/win_generate_yaml_files.cmd | 21 ++++++++++++++++++ scripts/win_help.cmd | 5 +++++ scripts/win_start_vueui.cmd | 44 +++++++++++++++++++++++++++++++++++++ 7 files changed, 110 insertions(+) create mode 100644 scripts/.gitignore create mode 100644 scripts/readme.md create mode 100644 scripts/win_build.cmd create mode 100644 scripts/win_compile_example.cmd create mode 100644 scripts/win_generate_yaml_files.cmd create mode 100644 scripts/win_help.cmd create mode 100644 scripts/win_start_vueui.cmd (limited to 'scripts') diff --git a/scripts/.gitignore b/scripts/.gitignore new file mode 100644 index 0000000..2cb7368 --- /dev/null +++ b/scripts/.gitignore @@ -0,0 +1 @@ +local_* diff --git a/scripts/readme.md b/scripts/readme.md new file mode 100644 index 0000000..9bb97ec --- /dev/null +++ b/scripts/readme.md @@ -0,0 +1,24 @@ +# ldgallery scripts + +Some utilities. +Prefix the filename of your custom script with "local_", they are git-ignored. + +## Build + +### win_build.cmd + +Build the compiler. See {../compiler/readme.md} + +### win_help.cmd + +Shows the compiler's command line help. + +### win_compile_example.cmd + +Compile the example gallery, for demonstration purposes. See {../example/readme.md} + +### win_generate_yaml_files.cmd + +Generates template YAML files for your gallery. +Copy this CMD to your pictures folder. + diff --git a/scripts/win_build.cmd b/scripts/win_build.cmd new file mode 100644 index 0000000..ed96211 --- /dev/null +++ b/scripts/win_build.cmd @@ -0,0 +1,5 @@ +@echo off +cd ..\compiler\ +stack setup +stack build +pause \ No newline at end of file diff --git a/scripts/win_compile_example.cmd b/scripts/win_compile_example.cmd new file mode 100644 index 0000000..e89b302 --- /dev/null +++ b/scripts/win_compile_example.cmd @@ -0,0 +1,10 @@ +@echo off +SET rebuild=--rebuild +CHOICE /M "Rebuild all ('--rebuild' argument)?" +IF ERRORLEVEL 2 SET rebuild= +echo. + +@echo on +cd ..\compiler\ +stack exec ldgallery-compiler-exe -- %rebuild% --clean-output -i=../example/ -o=../example/out/ +@pause diff --git a/scripts/win_generate_yaml_files.cmd b/scripts/win_generate_yaml_files.cmd new file mode 100644 index 0000000..edb7f91 --- /dev/null +++ b/scripts/win_generate_yaml_files.cmd @@ -0,0 +1,21 @@ +@echo off + +REM Copy this file to your picture directory to quickly generate the YAML templates +REM =============================================================================== + +for %%f in (*.jpg,*.png,*.gif) do ( + if exist "%%f.yaml" goto CONTINUE + @echo %%f + ( + echo title: %%f + echo. + echo datetime: + echo. + echo description: + echo. + echo tags: + echo - not_tagged + ) >> "%%f.yaml" + :CONTINUE + rem +) diff --git a/scripts/win_help.cmd b/scripts/win_help.cmd new file mode 100644 index 0000000..117205a --- /dev/null +++ b/scripts/win_help.cmd @@ -0,0 +1,5 @@ +@echo off +cd ..\compiler\ +stack exec ldgallery-compiler-exe -- --help +@echo. +@pause diff --git a/scripts/win_start_vueui.cmd b/scripts/win_start_vueui.cmd new file mode 100644 index 0000000..b79a7b7 --- /dev/null +++ b/scripts/win_start_vueui.cmd @@ -0,0 +1,44 @@ +@echo off +set NODE_VERSION=12.14.0 +set VUECLI_VERSION=4.2.2 +cd ..\viewer\ + +chcp 65001 +echo. +echo === nvm install === +nvm install %NODE_VERSION% +nvm list | find /i "%NODE_VERSION% (Currently" +if errorlevel 1 ( + echo. + echo === nvm use %NODE_VERSION% === + nvm use %NODE_VERSION% + + echo. + echo === npm install @vue/cli@%VUECLI_VERSION% === + ping localhost -n 3 >NUL + cmd /c npm install -g @vue/cli@%VUECLI_VERSION% +) +echo. +npm view -g @vue/cli version | find /i "%VUECLI_VERSION%" +if errorlevel 1 ( + echo ====================================================================== + echo Warning: vue/cli doesn't match the requested version: %VUECLI_VERSION% + echo. + echo CTRL+C to quit and update, or press a key to ignore this warning... + echo ====================================================================== + echo. + pause +) +echo. +echo === npm install === +cmd /c npm install +echo. +echo === npm prune === +cmd /c npm prune +echo. +echo === npm dedupe === +cmd /c npm dedupe +echo. +echo === vue ui === +title Vue UI - server +vue ui -- cgit v1.2.3