55# #############################################################################
66
77set -euo pipefail
8- cd $( dirname ${BASH_SOURCE[0]} )
8+ cd " $( dirname " ${BASH_SOURCE[0]} " ) "
99cd ..
1010
1111BASE_DIR=$( pwd)
1212TEMPLATE_HOME=/tmp/nodejs-microservices-template
1313TEMPLATE_REPO=git@github.com:azure-samples/nodejs-microservices-template.git
1414
1515echo " Preparing GitHub project template..."
16- rm -rf $TEMPLATE_HOME
17- mkdir -p $TEMPLATE_HOME
16+ rm -rf " $TEMPLATE_HOME "
17+ mkdir -p " $TEMPLATE_HOME "
1818find . -type d -not -path ' *node_modules*' -not -path ' *.git/*' -not -path ' ./packages*' -exec mkdir -p ' {}' " $TEMPLATE_HOME /{}" ' ;'
1919find . -type f -not -path ' *node_modules*' -not -path ' *.git/*' -not -path ' ./packages*' -exec cp -r ' {}' " $TEMPLATE_HOME /{}" ' ;'
20- cd $TEMPLATE_HOME
20+ cd " $TEMPLATE_HOME "
2121rm -rf .git
2222git init
2323
@@ -35,16 +35,18 @@ rm -rf docs
3535rm -rf .azure/.* .env
3636rm -rf .azure/_* .sh
3737mkdir -p docs/assets
38- cp $BASE_DIR /docs/assets/architecture.drawio.png docs/assets/architecture.drawio.png
38+ cp " $BASE_DIR /docs/assets/architecture.drawio.png" docs/assets/architecture.drawio.png
3939
4040# Build script
41+ # shellcheck disable=SC2016
4142echo -e ' #!/usr/bin/env bash
4243set -euo pipefail
4344cd "$(dirname "${BASH_SOURCE[0]}")/.."
4445
4546' > .azure/build.sh
4647
4748# Deploy script
49+ # shellcheck disable=SC2016
4850echo -e ' #!/usr/bin/env bash
4951set -eu
5052cd "$(dirname "${BASH_SOURCE[0]}")"
@@ -62,15 +64,15 @@ commit_sha="$(git rev-parse HEAD)"
6264
6365if [[ ${1-} == " --local" ]]; then
6466 echo " Local mode: skipping GitHub push."
65- open $TEMPLATE_HOME
67+ open " $TEMPLATE_HOME "
6668else
6769 # Update git repo
6870 git remote add origin $TEMPLATE_REPO
6971 git add .
7072 git commit -m " chore: initial commit"
7173 git push -u origin main --force
7274
73- rm -rf $TEMPLATE_HOME
75+ rm -rf " $TEMPLATE_HOME "
7476fi
7577
7678echo " Successfully updated project template."
0 commit comments