Skip to content

Commit

Permalink
Don't display excess spaces on warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
stuarthayhurst committed Jan 4, 2021
1 parent 673496b commit 2b45a1d
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -501,20 +501,27 @@ warnArgs() {
if [[ "$background" == "" ]] && [[ "$backgroundColour" == "" ]]; then
output "error" "No background or colour specified, use -b to list available backgrounds"
output "warning" " - Call the program with '-b [background]'"
exit 1
return 1
fi
if [[ "$background" != "" ]] && [[ "$backgroundColour" != "" ]]; then
output "error" "Use either a background or a colour, not both"
exit 1
return 1
fi
if [[ "$backgroundColour" != "" ]] && ! checkCommand convert; then
output "error" "Imagemagick / convert is required to use a custom background colour"
exit 1
return 1
fi
}

if [[ "$programOperation" == "install" ]] || [[ "$programOperation" == "preview" ]]; then
echo ""; warnArgs; echo ""
argWarnings="$(warnArgs)" || argsFailed="true"
if [[ "$argWarnings" != "" ]]; then
echo ""; echo "$argWarnings"; echo ""
if [[ "$argsFailed" == "true" ]]; then
exit 1
fi
fi

output "success" "Using the following settings:"
output "list" "Resolution: ${resolution^}"
if [[ "$background" != "" ]]; then
Expand Down

0 comments on commit 2b45a1d

Please sign in to comment.