]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
build/ship.sh: shellcheck fixes. (#30197)
authorXhmikosR <xhmikosr@gmail.com>
Thu, 5 Mar 2020 15:06:18 +0000 (17:06 +0200)
committerXhmikosR <xhmikosr@gmail.com>
Mon, 9 Mar 2020 14:08:41 +0000 (16:08 +0200)
Also add `set -e` so that if a command fails the whole script fails too.

build/ship.sh

index 2892843839cd79119d9042edec959f5583a2a1df..f1c5e38e35108a6954a1c1c9b398aa9c3f110e96 100755 (executable)
@@ -1,4 +1,7 @@
 #!/usr/bin/env bash
+
+set -e
+
 #
 # Usage
 # ---------------
@@ -18,35 +21,35 @@ end=$'\e[0m'
 current_version=$(node -p "require('./package.json').version")
 
 if [[ $# -lt 1 ]]; then
-  printf "\n%s⚠️  Shipping aborted. You must specify a version.\n%s" $red $end
+  printf "\n%s⚠️  Shipping aborted. You must specify a version.\n%s" "$red" "$end"
   exit 1
 fi
 
 # Pulling latest changes, just to be sure
-printf "\n%s=======================================================%s" $magenta $end
-printf "\n%sPulling latest changes...%s" $magenta $end
-printf "\n%s=======================================================\n\n%s" $magenta $end
+printf "\n%s=======================================================%s" "$magenta" "$end"
+printf "\n%sPulling latest changes...%s" "$magenta" "$end"
+printf "\n%s=======================================================\n\n%s" "$magenta" "$end"
 git pull origin v4-dev
 
 # Update version number
-printf "\n%s=======================================================%s" $magenta $end
-printf "\n%sUpdating version number...%s" $magenta $end
-printf "\n%s=======================================================\n%s" $magenta $end
+printf "\n%s=======================================================%s" "$magenta" "$end"
+printf "\n%sUpdating version number...%s" "$magenta" "$end"
+printf "\n%s=======================================================\n%s" "$magenta" "$end"
 npm run release-version "$current_version" "$1"
 
 # Build release
-printf "\n%s=======================================================%s" $magenta $end
-printf "\n%sBuilding release...%s" $magenta $end
-printf "\n%s=======================================================\n%s" $magenta $end
+printf "\n%s=======================================================%s" "$magenta" "$end"
+printf "\n%sBuilding release...%s" "$magenta" "$end"
+printf "\n%s=======================================================\n%s" "$magenta" "$end"
 npm run release
 
 # Copy the contents of the built docs site over to `bs-docs` repo
-printf "\n%s=======================================================%s" $magenta $end
-printf "\n%sCopy it over...%s" $magenta $end
-printf "\n%s=======================================================\n%s" $magenta $end
+printf "\n%s=======================================================%s" "$magenta" "$end"
+printf "\n%sCopy it over...%s" "$magenta" "$end"
+printf "\n%s=======================================================\n%s" "$magenta" "$end"
 cp -rf _gh_pages/. ../bs-docs/
 printf "\nDone!\n"
 
-printf "\n%s=======================================================%s" $green $end
-printf "\n%sSuccess, $1 is ready to review and publish.%s" $green $end
-printf "\n%s=======================================================\n\n%s" $green $end
+printf "\n%s=======================================================%s" "$green" "$end"
+printf "\n%sSuccess, $1 is ready to review and publish.%s" "$green" "$end"
+printf "\n%s=======================================================\n\n%s" "$green" "$end"