Skip to content

Commit

Permalink
Fix the test tool and CD hook
Browse files Browse the repository at this point in the history
  • Loading branch information
cotes2020 committed Nov 20, 2020
1 parent 2c48822 commit ec69d4d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/pages-deploy.yml.hook
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,12 @@ jobs:

- name: Test Site
run: |
bash tools/test.sh "$SPEC_TEST"

if [[ -n $SPEC_TEST ]]; then
bash tools/test.sh -d "$SPEC_TEST"
else
bash tools/test.sh
fi

- name: Deploy
run: |
bash tools/deploy.sh
15 changes: 13 additions & 2 deletions tools/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ help() {
echo " bash ./tools/test.sh [options]"
echo
echo "Options:"
echo " --build Run jekyll build before testing."
echo " -h, --help Print this information."
echo " --build Run Jekyll build before test."
echo " -d, --dir <path> Specify the test path."
echo " -h, --help Print this information."
}

if [[ -n $1 && -d $1 ]]; then
Expand All @@ -37,6 +38,16 @@ while (($#)); do
_build=true
shift
;;
-d | --dir)
if [[ ! -d $2 ]]; then
echo -e "Error: path '$2' doesn't exist\n"
help
exit 1
fi
DEST=$2
shift
shift
;;
-h | --help)
help
exit 0
Expand Down

0 comments on commit ec69d4d

Please sign in to comment.