From f3cbb5c52c6468723b2c2e1174fb17f33a022532 Mon Sep 17 00:00:00 2001 From: andy5995 Date: Tue, 11 Oct 2022 14:36:27 -0500 Subject: [PATCH] add optional 'remove_from_pyromod' argument closes #6 --- .github/workflows/test.yml | 1 + ChangeLog | 4 ++++ README.md | 18 +++++++++++++----- action.yml | 4 ++++ entrypoint.sh | 7 +++++++ 5 files changed, 29 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 44b63a1..da20c61 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -49,3 +49,4 @@ jobs: name: ${{ env.MOD_NAME }} version: ${{ env.MOD_VERSION }} directory: 'test/${{ env.MOD_NAME }}' + remove_from_pyromod: '/art/textures/ui/session/portraits/* /art/textures/skins/skeletal/eastern/*' diff --git a/ChangeLog b/ChangeLog index bd3e519..df4a7a8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,10 @@ * release v1.3.1 +2022-10-11 + + * add optional 'remove_from_pyromod' argument + 2022-10-08 * Add optional 'directory' argument diff --git a/README.md b/README.md index b329f1c..fca69b0 100644 --- a/README.md +++ b/README.md @@ -100,11 +100,19 @@ jobs: ## Option table -| name | required | default | -|----------|--------|------| -| name | true | '' | -| version | true | '' | -| directory (where mod.json is located | false | '.' | +| name | required | description | default | +|----------|--------|-------------|--------| +| name | true | | | +| version | true | | | +| directory | false | relative path to your mod.json file | '.' | +| remove_from_pyromod | false | list of files or directories to remove, each separated by a space (wildcards ok) | | + +Note that this action will remove '.git*' from the pyromod by default +and doesn't need to be added to the 'remove_from_pyromod' string. + +remove_from_pyromod example: + + remove_from_pyromod: 'foo bar /package.json /.*' ## Additional Notes diff --git a/action.yml b/action.yml index ce751cd..c86234d 100644 --- a/action.yml +++ b/action.yml @@ -13,6 +13,10 @@ inputs: description: "relative path to your mod.json file" required: false default: '.' + remove_from_pyromod: + description: "list of files or directories to remove, each separated by a space" + required: false + default: '' runs: using: docker diff --git a/entrypoint.sh b/entrypoint.sh index 02c748f..71698a4 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -18,3 +18,10 @@ su user0ad --command "/home/user0ad/usr/bin/pyrogenesis \ && test -f "$OUTPUT_FILE" zip -d "$OUTPUT_FILE" ".git*" + +for item in $INPUT_REMOVE_FROM_PYROMOD; do + if [ -z "${item##*.git*}" ]; then + continue + fi + zip -d "$OUTPUT_FILE" "$item" +done