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 From 1ee205fd6cde9ee43330fb37fc408d0b6ef07bf1 Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Tue, 25 Feb 2020 14:57:56 +0100 Subject: scripts: updated the scripts to the new binary name (lost commit because of rebase) --- scripts/win_compile_example.cmd | 2 +- scripts/win_help.cmd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/win_compile_example.cmd b/scripts/win_compile_example.cmd index 1226269..35134c0 100644 --- a/scripts/win_compile_example.cmd +++ b/scripts/win_compile_example.cmd @@ -6,5 +6,5 @@ echo. cd ..\compiler\ @echo on -stack exec ldgallery-compiler-exe -- %rebuild% --clean-output -i=../example/src/ -o=../example/out/ +stack exec ldgallery -- %rebuild% --clean-output -i=../example/src/ -o=../example/out/ @pause diff --git a/scripts/win_help.cmd b/scripts/win_help.cmd index 117205a..f0bdb98 100644 --- a/scripts/win_help.cmd +++ b/scripts/win_help.cmd @@ -1,5 +1,5 @@ @echo off cd ..\compiler\ -stack exec ldgallery-compiler-exe -- --help +stack exec ldgallery -- --help @echo. @pause -- cgit v1.2.3 From c7fa5bd40d0e5c9ea50190a90a0ccfee8ad96c25 Mon Sep 17 00:00:00 2001 From: pacien Date: Thu, 27 Feb 2020 21:05:51 +0100 Subject: viewer: use colon as tag separator instead of dot For consistency with the query language and allowing the use of the very common dot in tags. This also introduces a migration script. GitHub: closes #164 --- scripts/migrate_tags_dot_to_colon.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 scripts/migrate_tags_dot_to_colon.py (limited to 'scripts') diff --git a/scripts/migrate_tags_dot_to_colon.py b/scripts/migrate_tags_dot_to_colon.py new file mode 100755 index 0000000..bf56c4c --- /dev/null +++ b/scripts/migrate_tags_dot_to_colon.py @@ -0,0 +1,25 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i python -p "python3.withPackages (ps: with ps; [ruamel_yaml])" + +from argparse import ArgumentParser +from ruamel.yaml import YAML +from collections.abc import Iterable + +parser = ArgumentParser(description='Converts tag separator from dot to colon in sidecar files, easing migration after GH-164.') +parser.add_argument('file', type=str, nargs='+', help='YAML sidecar file(s) to migrate.') +args = parser.parse_args() + +yaml = YAML(typ='rt') # preserve order, style and comments +yaml.indent(mapping=2, sequence=2, offset=2) + +for file_path in args.file: + with open(file_path, 'r+') as file: + sidecar = yaml.load(file) + if not sidecar: continue + + if 'tags' in sidecar and isinstance(sidecar['tags'], Iterable): + sidecar['tags'] = [tag.replace('.', ':') for tag in sidecar['tags']] + + file.seek(0) + yaml.dump(sidecar, file) + file.truncate() -- cgit v1.2.3 From 78961dd465779c6df40425fa49a8d30cd6b89fed Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Thu, 2 Apr 2020 17:44:52 +0200 Subject: viewer: dependancies and environment upgrade --- scripts/win_start_vueui.cmd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/win_start_vueui.cmd b/scripts/win_start_vueui.cmd index b79a7b7..e1a124d 100644 --- a/scripts/win_start_vueui.cmd +++ b/scripts/win_start_vueui.cmd @@ -1,6 +1,6 @@ @echo off -set NODE_VERSION=12.14.0 -set VUECLI_VERSION=4.2.2 +set NODE_VERSION=12.16.1 +set VUECLI_VERSION=4.2.3 cd ..\viewer\ chcp 65001 @@ -19,7 +19,7 @@ if errorlevel 1 ( cmd /c npm install -g @vue/cli@%VUECLI_VERSION% ) echo. -npm view -g @vue/cli version | find /i "%VUECLI_VERSION%" +vue --version | find /i "%VUECLI_VERSION%" if errorlevel 1 ( echo ====================================================================== echo Warning: vue/cli doesn't match the requested version: %VUECLI_VERSION% -- cgit v1.2.3 From 16ff1c8a3c1be0298a9732ed272c7ba02e2cd9d0 Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Sat, 2 May 2020 02:18:22 +0200 Subject: travis: renamed unwated scripts to remove them from the release --- scripts/dev_win_build.cmd | 5 +++++ scripts/dev_win_compile_example.cmd | 10 +++++++++ scripts/dev_win_start_vueui.cmd | 44 +++++++++++++++++++++++++++++++++++++ scripts/win_build.cmd | 5 ----- scripts/win_compile_example.cmd | 10 --------- scripts/win_start_vueui.cmd | 44 ------------------------------------- 6 files changed, 59 insertions(+), 59 deletions(-) create mode 100644 scripts/dev_win_build.cmd create mode 100644 scripts/dev_win_compile_example.cmd create mode 100644 scripts/dev_win_start_vueui.cmd delete mode 100644 scripts/win_build.cmd delete mode 100644 scripts/win_compile_example.cmd delete mode 100644 scripts/win_start_vueui.cmd (limited to 'scripts') diff --git a/scripts/dev_win_build.cmd b/scripts/dev_win_build.cmd new file mode 100644 index 0000000..ed96211 --- /dev/null +++ b/scripts/dev_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/dev_win_compile_example.cmd b/scripts/dev_win_compile_example.cmd new file mode 100644 index 0000000..35134c0 --- /dev/null +++ b/scripts/dev_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. +cd ..\compiler\ + +@echo on +stack exec ldgallery -- %rebuild% --clean-output -i=../example/src/ -o=../example/out/ +@pause diff --git a/scripts/dev_win_start_vueui.cmd b/scripts/dev_win_start_vueui.cmd new file mode 100644 index 0000000..e1a124d --- /dev/null +++ b/scripts/dev_win_start_vueui.cmd @@ -0,0 +1,44 @@ +@echo off +set NODE_VERSION=12.16.1 +set VUECLI_VERSION=4.2.3 +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. +vue --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 diff --git a/scripts/win_build.cmd b/scripts/win_build.cmd deleted file mode 100644 index ed96211..0000000 --- a/scripts/win_build.cmd +++ /dev/null @@ -1,5 +0,0 @@ -@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 deleted file mode 100644 index 35134c0..0000000 --- a/scripts/win_compile_example.cmd +++ /dev/null @@ -1,10 +0,0 @@ -@echo off -SET rebuild=--rebuild -CHOICE /M "Rebuild all ('--rebuild' argument)?" -IF ERRORLEVEL 2 SET rebuild= -echo. -cd ..\compiler\ - -@echo on -stack exec ldgallery -- %rebuild% --clean-output -i=../example/src/ -o=../example/out/ -@pause diff --git a/scripts/win_start_vueui.cmd b/scripts/win_start_vueui.cmd deleted file mode 100644 index e1a124d..0000000 --- a/scripts/win_start_vueui.cmd +++ /dev/null @@ -1,44 +0,0 @@ -@echo off -set NODE_VERSION=12.16.1 -set VUECLI_VERSION=4.2.3 -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. -vue --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 From 874a355f19a60624de0e371e665b1dfd7e6fe492 Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Sat, 2 May 2020 02:22:33 +0200 Subject: travis: renamed unwanted scripts to remove them from the release (added win_help) Renamed the files in readme.md --- scripts/dev_win_help.cmd | 5 +++++ scripts/readme.md | 6 +++--- scripts/win_help.cmd | 5 ----- 3 files changed, 8 insertions(+), 8 deletions(-) create mode 100644 scripts/dev_win_help.cmd delete mode 100644 scripts/win_help.cmd (limited to 'scripts') diff --git a/scripts/dev_win_help.cmd b/scripts/dev_win_help.cmd new file mode 100644 index 0000000..f0bdb98 --- /dev/null +++ b/scripts/dev_win_help.cmd @@ -0,0 +1,5 @@ +@echo off +cd ..\compiler\ +stack exec ldgallery -- --help +@echo. +@pause diff --git a/scripts/readme.md b/scripts/readme.md index 9bb97ec..a20d858 100644 --- a/scripts/readme.md +++ b/scripts/readme.md @@ -5,15 +5,15 @@ Prefix the filename of your custom script with "local_", they are git-ignored. ## Build -### win_build.cmd +### dev_win_build.cmd Build the compiler. See {../compiler/readme.md} -### win_help.cmd +### dev_win_help.cmd Shows the compiler's command line help. -### win_compile_example.cmd +### dev_win_compile_example.cmd Compile the example gallery, for demonstration purposes. See {../example/readme.md} diff --git a/scripts/win_help.cmd b/scripts/win_help.cmd deleted file mode 100644 index f0bdb98..0000000 --- a/scripts/win_help.cmd +++ /dev/null @@ -1,5 +0,0 @@ -@echo off -cd ..\compiler\ -stack exec ldgallery -- --help -@echo. -@pause -- cgit v1.2.3