Skip to content

Commit

Permalink
Fix quoting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Drewsif committed Jun 13, 2020
1 parent c806425 commit 370e88d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pishrink.sh
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ fi

# check selected compression tool is supported and installed
if [[ -n $ziptool ]]; then
if [[ ! " ${ZIPTOOLS[@]} " =~ " $ziptool " ]]; then
if [[ ! " ${ZIPTOOLS[@]} " =~ $ziptool ]]; then
error $LINENO "$ziptool is an unsupported ziptool."
exit -17
else
Expand All @@ -246,7 +246,7 @@ done
#Copy to new file if requested
if [ -n "$2" ]; then
f="$2"
if [[ -n $ziptool && "${f##*.}" == ${ZIPEXTENSIONS[$ziptool]} ]]; then # remove zip extension if zip requested because zip tool will complain about extension
if [[ -n $ziptool && "${f##*.}" == "${ZIPEXTENSIONS[$ziptool]}" ]]; then # remove zip extension if zip requested because zip tool will complain about extension
f="${f%.*}"
fi
info "Copying $1 to $f..."
Expand Down Expand Up @@ -392,15 +392,15 @@ if [[ -n $ziptool ]]; then
if [[ $parallel == true ]]; then
parallel_tool="${ZIP_PARALLEL_TOOL[$ziptool]}"
info "Using $parallel_tool on the shrunk image"
if ! $parallel_tool ${options} "$img"; then
if ! $parallel_tool "${options}" "$img"; then
rc=$?
error $LINENO "$parallel_tool failed with rc $rc"
exit -18
fi

else # sequential
info "Using $ziptool on the shrunk image"
if ! $ziptool ${options} $img; then
if ! $ziptool "${options}" "$img"; then
rc=$?
error $LINENO "$ziptool failed with rc $rc"
exit -19
Expand Down

0 comments on commit 370e88d

Please sign in to comment.