diff --git a/scripts/zola.sh b/scripts/zola.sh index ca52974..9dffbd0 100755 --- a/scripts/zola.sh +++ b/scripts/zola.sh @@ -97,7 +97,14 @@ deploy() { original_branch=$(git branch --show-current) tmp_dir=$(mktemp -d) cp -r $2/* $tmp_dir - git checkout --orphan $1 + + if [[ -z $(git branch --list $1) ]] + then + git checkout --orphan $1 + else + git checkout $1 + fi + git rm -rf . /bin/rm -rf * cp -r $tmp_dir/* .