Skip to content

Commit

Permalink
Fix exclusions.
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDoctor0 committed Jul 2, 2020
1 parent a173f91 commit a1afcab
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 @@ -7,24 +7,24 @@ printf "\n📦 Creating %s archive...\n" "$5"

if [ "$3" != "." ]
then
cd "$3"
cd $3
fi

if [ "$5" = "zip" ]
then
if [ -z "$4" ]
then
zip -r "$1" "$2" || { printf "\n⛔ Unable to create %s archive.\n" "$5"; exit 1; }
zip -r $1 $2 || { printf "\n⛔ Unable to create %s archive.\n" "$5"; exit 1; }
else
zip -r "$1" "$2" -x "$4" || { printf "\n⛔ Unable to create %s archive.\n" "$5"; exit 1; }
zip -r $1 $2 -x $4 || { printf "\n⛔ Unable to create %s archive.\n" "$5"; exit 1; }
fi
elif [ "$5" = "tar" ]
then
if [ -z "$4" ]
then
tar -zcvf "$1" "$2" || { printf "\n⛔ Unable to create %s archive.\n" "$5"; exit 1; }
tar -zcvf $1 $2 || { printf "\n⛔ Unable to create %s archive.\n" "$5"; exit 1; }
else
tar -zcvf "$1" "$2" --exclude="$4" || { printf "\n⛔ Unable to create %s archive.\n" "$5"; exit 1; }
tar -zcvf $1 $2 --exclude=$4 || { printf "\n⛔ Unable to create %s archive.\n" "$5"; exit 1; }
fi
else
printf "\n⛔ Invalid archiving tool.\n"; exit 1;
Expand Down

0 comments on commit a1afcab

Please sign in to comment.