Skip to content

Commit ec69d4d

Browse files
committed
Fix the test tool and CD hook
1 parent 2c48822 commit ec69d4d

2 files changed

Lines changed: 19 additions & 4 deletions

File tree

.github/workflows/pages-deploy.yml.hook

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,12 @@ jobs:
6767

6868
- name: Test Site
6969
run: |
70-
bash tools/test.sh "$SPEC_TEST"
71-
70+
if [[ -n $SPEC_TEST ]]; then
71+
bash tools/test.sh -d "$SPEC_TEST"
72+
else
73+
bash tools/test.sh
74+
fi
75+
7276
- name: Deploy
7377
run: |
7478
bash tools/deploy.sh

tools/test.sh

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ help() {
2222
echo " bash ./tools/test.sh [options]"
2323
echo
2424
echo "Options:"
25-
echo " --build Run jekyll build before testing."
26-
echo " -h, --help Print this information."
25+
echo " --build Run Jekyll build before test."
26+
echo " -d, --dir <path> Specify the test path."
27+
echo " -h, --help Print this information."
2728
}
2829

2930
if [[ -n $1 && -d $1 ]]; then
@@ -37,6 +38,16 @@ while (($#)); do
3738
_build=true
3839
shift
3940
;;
41+
-d | --dir)
42+
if [[ ! -d $2 ]]; then
43+
echo -e "Error: path '$2' doesn't exist\n"
44+
help
45+
exit 1
46+
fi
47+
DEST=$2
48+
shift
49+
shift
50+
;;
4051
-h | --help)
4152
help
4253
exit 0

0 commit comments

Comments
 (0)