Skip to content

Commit

Permalink
Add support for custom command parameters.
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDoctor0 committed Jan 12, 2023
1 parent 080160a commit 7a1d901
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ then
then
if [ -z "$INPUT_EXCLUSIONS" ]
then
7z a -tzip $INPUT_FILENAME $INPUT_PATH || { printf "\n⛔ Unable to create %s archive.\n" "$INPUT_TYPE"; exit 1; }
7z a -tzip $INPUT_FILENAME $INPUT_PATH $INPUT_CUSTOM || { printf "\n⛔ Unable to create %s archive.\n" "$INPUT_TYPE"; exit 1; }
else
EXCLUSIONS=''

Expand All @@ -32,21 +32,21 @@ then
EXCLUSIONS+=$EXCLUSION
done

7z a -tzip $INPUT_FILENAME $INPUT_PATH $EXCLUSIONS || { printf "\n⛔ Unable to create %s archive.\n" "$INPUT_TYPE"; exit 1; }
7z a -tzip $INPUT_FILENAME $INPUT_PATH $EXCLUSIONS $INPUT_CUSTOM || { printf "\n⛔ Unable to create %s archive.\n" "$INPUT_TYPE"; exit 1; }
fi
else
if [ -z "$INPUT_EXCLUSIONS" ]
then
zip -r $INPUT_FILENAME $INPUT_PATH || { printf "\n⛔ Unable to create %s archive.\n" "$INPUT_TYPE"; exit 1; }
else
zip -r $INPUT_FILENAME $INPUT_PATH -x $INPUT_EXCLUSIONS || { printf "\n⛔ Unable to create %s archive.\n" "$INPUT_TYPE"; exit 1; }
zip -r $INPUT_FILENAME $INPUT_PATH -x $INPUT_EXCLUSIONS $INPUT_CUSTOM || { printf "\n⛔ Unable to create %s archive.\n" "$INPUT_TYPE"; exit 1; }
fi
fi
elif [ "$INPUT_TYPE" = "tar" ]
then
if [ -z "$INPUT_EXCLUSIONS" ]
then
tar -zcvf $INPUT_FILENAME $INPUT_PATH || { printf "\n⛔ Unable to create %s archive.\n" "$INPUT_TYPE"; exit 1; }
tar -zcvf $INPUT_FILENAME $INPUT_PATH $INPUT_CUSTOM || { printf "\n⛔ Unable to create %s archive.\n" "$INPUT_TYPE"; exit 1; }
else
EXCLUSIONS=''

Expand All @@ -56,7 +56,7 @@ then
EXCLUSIONS+=$EXCLUSION
done

tar $EXCLUSIONS -zcvf $INPUT_FILENAME $INPUT_PATH || { printf "\n⛔ Unable to create %s archive.\n" "$INPUT_TYPE"; exit 1; }
tar $EXCLUSIONS -zcvf $INPUT_FILENAME $INPUT_PATH $INPUT_CUSTOM || { printf "\n⛔ Unable to create %s archive.\n" "$INPUT_TYPE"; exit 1; }
fi
else
printf "\n⛔ Invalid archiving tool.\n"; exit 1;
Expand Down

0 comments on commit 7a1d901

Please sign in to comment.