diff options
author | pacien | 2020-05-02 04:11:24 +0200 |
---|---|---|
committer | pacien | 2020-05-02 04:11:24 +0200 |
commit | 8e3ac8fe44bebb38e1882ca7f06b8100078ad88d (patch) | |
tree | a748fa1e639cb3b5e1f24a8150e89dbb28c980cb /scripts | |
parent | 7042ffc06326fa8ffe70f5a59747709250166c16 (diff) | |
parent | 0e0b5b0ae44da7c1d67983dedd8f8d8d3516236f (diff) | |
download | ldgallery-1.0.tar.gz |
Merge branch 'develop': release v1.0v1.0
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/.gitignore | 1 | ||||
-rw-r--r-- | scripts/dev_win_build.cmd | 5 | ||||
-rw-r--r-- | scripts/dev_win_compile_example.cmd | 10 | ||||
-rw-r--r-- | scripts/dev_win_help.cmd | 5 | ||||
-rw-r--r-- | scripts/dev_win_start_vueui.cmd | 44 | ||||
-rwxr-xr-x | scripts/migrate_tags_dot_to_colon.py | 25 | ||||
-rw-r--r-- | scripts/readme.md | 24 | ||||
-rw-r--r-- | scripts/win_generate_yaml_files.cmd | 21 |
8 files changed, 135 insertions, 0 deletions
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/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 @@ | |||
1 | @echo off | ||
2 | cd ..\compiler\ | ||
3 | stack setup | ||
4 | stack build | ||
5 | 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 @@ | |||
1 | @echo off | ||
2 | SET rebuild=--rebuild | ||
3 | CHOICE /M "Rebuild all ('--rebuild' argument)?" | ||
4 | IF ERRORLEVEL 2 SET rebuild= | ||
5 | echo. | ||
6 | cd ..\compiler\ | ||
7 | |||
8 | @echo on | ||
9 | stack exec ldgallery -- %rebuild% --clean-output -i=../example/src/ -o=../example/out/ | ||
10 | @pause | ||
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 @@ | |||
1 | @echo off | ||
2 | cd ..\compiler\ | ||
3 | stack exec ldgallery -- --help | ||
4 | @echo. | ||
5 | @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 @@ | |||
1 | @echo off | ||
2 | set NODE_VERSION=12.16.1 | ||
3 | set VUECLI_VERSION=4.2.3 | ||
4 | cd ..\viewer\ | ||
5 | |||
6 | chcp 65001 | ||
7 | echo. | ||
8 | echo === nvm install === | ||
9 | nvm install %NODE_VERSION% | ||
10 | nvm list | find /i "%NODE_VERSION% (Currently" | ||
11 | if errorlevel 1 ( | ||
12 | echo. | ||
13 | echo === nvm use %NODE_VERSION% === | ||
14 | nvm use %NODE_VERSION% | ||
15 | |||
16 | echo. | ||
17 | echo === npm install @vue/cli@%VUECLI_VERSION% === | ||
18 | ping localhost -n 3 >NUL | ||
19 | cmd /c npm install -g @vue/cli@%VUECLI_VERSION% | ||
20 | ) | ||
21 | echo. | ||
22 | vue --version | find /i "%VUECLI_VERSION%" | ||
23 | if errorlevel 1 ( | ||
24 | echo ====================================================================== | ||
25 | echo Warning: vue/cli doesn't match the requested version: %VUECLI_VERSION% | ||
26 | echo. | ||
27 | echo CTRL+C to quit and update, or press a key to ignore this warning... | ||
28 | echo ====================================================================== | ||
29 | echo. | ||
30 | pause | ||
31 | ) | ||
32 | echo. | ||
33 | echo === npm install === | ||
34 | cmd /c npm install | ||
35 | echo. | ||
36 | echo === npm prune === | ||
37 | cmd /c npm prune | ||
38 | echo. | ||
39 | echo === npm dedupe === | ||
40 | cmd /c npm dedupe | ||
41 | echo. | ||
42 | echo === vue ui === | ||
43 | title Vue UI - server | ||
44 | vue ui | ||
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 @@ | |||
1 | #!/usr/bin/env nix-shell | ||
2 | #!nix-shell -i python -p "python3.withPackages (ps: with ps; [ruamel_yaml])" | ||
3 | |||
4 | from argparse import ArgumentParser | ||
5 | from ruamel.yaml import YAML | ||
6 | from collections.abc import Iterable | ||
7 | |||
8 | parser = ArgumentParser(description='Converts tag separator from dot to colon in sidecar files, easing migration after GH-164.') | ||
9 | parser.add_argument('file', type=str, nargs='+', help='YAML sidecar file(s) to migrate.') | ||
10 | args = parser.parse_args() | ||
11 | |||
12 | yaml = YAML(typ='rt') # preserve order, style and comments | ||
13 | yaml.indent(mapping=2, sequence=2, offset=2) | ||
14 | |||
15 | for file_path in args.file: | ||
16 | with open(file_path, 'r+') as file: | ||
17 | sidecar = yaml.load(file) | ||
18 | if not sidecar: continue | ||
19 | |||
20 | if 'tags' in sidecar and isinstance(sidecar['tags'], Iterable): | ||
21 | sidecar['tags'] = [tag.replace('.', ':') for tag in sidecar['tags']] | ||
22 | |||
23 | file.seek(0) | ||
24 | yaml.dump(sidecar, file) | ||
25 | file.truncate() | ||
diff --git a/scripts/readme.md b/scripts/readme.md new file mode 100644 index 0000000..a20d858 --- /dev/null +++ b/scripts/readme.md | |||
@@ -0,0 +1,24 @@ | |||
1 | # ldgallery scripts | ||
2 | |||
3 | Some utilities. | ||
4 | Prefix the filename of your custom script with "local_", they are git-ignored. | ||
5 | |||
6 | ## Build | ||
7 | |||
8 | ### dev_win_build.cmd | ||
9 | |||
10 | Build the compiler. See {../compiler/readme.md} | ||
11 | |||
12 | ### dev_win_help.cmd | ||
13 | |||
14 | Shows the compiler's command line help. | ||
15 | |||
16 | ### dev_win_compile_example.cmd | ||
17 | |||
18 | Compile the example gallery, for demonstration purposes. See {../example/readme.md} | ||
19 | |||
20 | ### win_generate_yaml_files.cmd | ||
21 | |||
22 | Generates template YAML files for your gallery. | ||
23 | Copy this CMD to your pictures folder. | ||
24 | |||
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 @@ | |||
1 | @echo off | ||
2 | |||
3 | REM Copy this file to your picture directory to quickly generate the YAML templates | ||
4 | REM =============================================================================== | ||
5 | |||
6 | for %%f in (*.jpg,*.png,*.gif) do ( | ||
7 | if exist "%%f.yaml" goto CONTINUE | ||
8 | @echo %%f | ||
9 | ( | ||
10 | echo title: %%f | ||
11 | echo. | ||
12 | echo datetime: | ||
13 | echo. | ||
14 | echo description: | ||
15 | echo. | ||
16 | echo tags: | ||
17 | echo - not_tagged | ||
18 | ) >> "%%f.yaml" | ||
19 | :CONTINUE | ||
20 | rem | ||
21 | ) | ||