add optional 'remove_from_pyromod' argument

closes #6
This commit is contained in:
andy5995 2022-10-11 14:36:27 -05:00 committed by Andy Alt
parent 2390d7164b
commit f3cbb5c52c
5 changed files with 29 additions and 5 deletions

View File

@ -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/*'

View File

@ -2,6 +2,10 @@
* release v1.3.1
2022-10-11
* add optional 'remove_from_pyromod' argument
2022-10-08
* Add optional 'directory' argument

View File

@ -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

View File

@ -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

View File

@ -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