File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ init() {
2424}
2525
2626backup () {
27- mv _site " $_backup_dir "
27+ mv _site/ * " $_backup_dir "
2828 mv .git " $_backup_dir "
2929
3030 # When adding custom domain from Github website,
Original file line number Diff line number Diff line change @@ -24,13 +24,18 @@ help() {
2424check_init () {
2525 local _has_inited=false
2626
27- if [[ -d .github ]]; then
28- if [[ -f .github/workflows/$ACTIONS_WORKFLOW && \
29- $( find .github/workflows/ -type f -name " *.yml" | wc -l) == 1 ]]; then
30- _has_inited=true
27+ if [[ ! -d docs ]]; then
28+ if [[ ! -d .github ]]; then
29+ _has_inited=true # --no-gh
30+ else
31+ if [[ -f .github/workflows/$ACTIONS_WORKFLOW ]]; then
32+ # on BSD, the `wc` could contains blank
33+ local _count=" $( find .github/workflows/ -type f -name " *.yml" | wc -l) "
34+ if [[ ${_count// [[:blank:]]/ } == 1 ]]; then
35+ _has_inited=true
36+ fi
37+ fi
3138 fi
32- else
33- _has_inited=true
3439 fi
3540
3641 if $_has_inited ; then
You can’t perform that action at this time.
0 commit comments