Skip to content

Commit e1f91e0

Browse files
committed
🐛 🔧 ci: Fix Shellcheck warnings in deploy script
Warnings identified by @iperdomo in PR #2. Signed-off-by: Justin W. Flory (he/him) [UNICEF Innovation] <[email protected]>
1 parent 2912c11 commit e1f91e0

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

.circleci/deploy.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,26 @@
33
# Force-push the built HTML to the `gh-pages` branch.
44
#
55

6-
set -e
6+
set -eu
77

88
DEPLOY_DIR=~/project
99

1010
# trust GitHub server keys
11-
if [ ! -d ~/.ssh/ ]; then
11+
if [[ ! -d ~/.ssh/ ]]; then
1212
mkdir ~/.ssh/
1313
fi
1414
ssh-keyscan github.com >> ~/.ssh/known_hosts
1515

1616
# stage generated HTML for GitHub Pages
17-
git clone --quiet --branch=gh-pages $CIRCLE_REPOSITORY_URL $DEPLOY_DIR
18-
rsync --archive --recursive --verbose --remove-source-files $HOME/hugo/$CIRCLE_PROJECT_REPONAME/public/* $DEPLOY_DIR
17+
git clone --quiet --branch=gh-pages "$CIRCLE_REPOSITORY_URL" "$DEPLOY_DIR"
18+
rsync --archive --recursive --verbose --remove-source-files $HOME/hugo/$CIRCLE_PROJECT_REPONAME/public/* "$DEPLOY_DIR"
1919

2020
# git client setup
21-
cd $DEPLOY_DIR
21+
cd "$DEPLOY_DIR"
2222
git config --global push.default simple
23-
git config --global user.email $(git --no-pager show --no-patch --format='%ae' HEAD)
23+
git config --global user.email "$(git --no-pager show --no-patch --format='%ae' HEAD)"
2424
if [ -n $CIRCLE_USERNAME ]; then
25-
git config --global user.name $CIRCLE_USERNAME
25+
git config --global user.name "$CIRCLE_USERNAME"
2626
else
2727
git config --global user.name "Committer not registered on CircleCI"
2828
fi

0 commit comments

Comments
 (0)