Improve the init tool & fix the deploy tool.
This commit is contained in:
parent
9dcab7ac1f
commit
13abcd5958
2 changed files with 12 additions and 7 deletions
|
@ -24,7 +24,7 @@ init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
backup() {
|
backup() {
|
||||||
mv _site "$_backup_dir"
|
mv _site/* "$_backup_dir"
|
||||||
mv .git "$_backup_dir"
|
mv .git "$_backup_dir"
|
||||||
|
|
||||||
# When adding custom domain from Github website,
|
# When adding custom domain from Github website,
|
||||||
|
|
|
@ -24,13 +24,18 @@ help() {
|
||||||
check_init() {
|
check_init() {
|
||||||
local _has_inited=false
|
local _has_inited=false
|
||||||
|
|
||||||
if [[ -d .github ]]; then
|
if [[ ! -d docs ]]; then
|
||||||
if [[ -f .github/workflows/$ACTIONS_WORKFLOW && \
|
if [[ ! -d .github ]]; then
|
||||||
$(find .github/workflows/ -type f -name "*.yml" | wc -l) == 1 ]]; then
|
_has_inited=true # --no-gh
|
||||||
_has_inited=true
|
else
|
||||||
|
if [[ -f .github/workflows/$ACTIONS_WORKFLOW ]]; then
|
||||||
|
# on BSD, the `wc` could contains blank
|
||||||
|
local _count="$(find .github/workflows/ -type f -name "*.yml" | wc -l)"
|
||||||
|
if [[ ${_count//[[:blank:]]/} == 1 ]]; then
|
||||||
|
_has_inited=true
|
||||||
|
fi
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
|
||||||
_has_inited=true
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if $_has_inited; then
|
if $_has_inited; then
|
||||||
|
|
Loading…
Reference in a new issue