Skip to content
Snippets Groups Projects
Commit 222c8217 authored by Reiter, Christoph's avatar Reiter, Christoph :snake:
Browse files

shellcheck fixes

parent 396555d7
Branches
No related tags found
No related merge requests found
Pipeline #283550 passed
...@@ -6,17 +6,13 @@ ...@@ -6,17 +6,13 @@
set -euo pipefail set -euo pipefail
export SHELLOPTS export SHELLOPTS
BIN_PATH="`dirname \"$0\"`" # relative
BIN_PATH="`( cd \"$BIN_PATH\" && pwd )`" # absolutized and normalized
install_app () { install_app () {
# Set "/" as default path # Set "/" as default path
path=${3:-/} path=${3:-/}
destDir=${2:-.} destDir=${2:-.}
echo $destDir echo "$destDir"
# Remove trailing slash from path # Remove trailing slash from path
path=${path%/} path=${path%/}
...@@ -26,8 +22,8 @@ install_app () { ...@@ -26,8 +22,8 @@ install_app () {
echo "Installing app: '$packageName' in directory '$destDir' with path prefix '$path'..."; echo "Installing app: '$packageName' in directory '$destDir' with path prefix '$path'...";
# Do a basic check if a path was entered # Do a basic check if a path was entered
if [[ $destDir != "." && $destDir != ".." ]]; then if [[ "$destDir" != "." && "$destDir" != ".." ]]; then
mkdir -p $destDir && cd $_ || exit 2; mkdir -p "$destDir" && cd "$_" || exit 2;
fi fi
npm init -y || exit 2; npm init -y || exit 2;
...@@ -60,7 +56,7 @@ case $1 in ...@@ -60,7 +56,7 @@ case $1 in
install_app "${@:2}" install_app "${@:2}"
;; ;;
"update-app") "update-app")
update_app $2 update_app "$2"
;; ;;
*) *)
echo "Unknown command: $1"; echo "Unknown command: $1";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment