Skip to content

Commit e96cd6b

Browse files
author
River@devbox
committed
Preserve deploy.sh when switching to gh-pages branch
1 parent f8f0281 commit e96cd6b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

deploy.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ if git show-ref --verify --quiet refs/heads/gh-pages; then
4848
git checkout gh-pages
4949
else
5050
git checkout --orphan gh-pages
51-
git rm -rf .
51+
git rm -rf . -- ':!deploy.sh'
5252
fi
5353

54-
# Remove old files (except .git)
55-
find . -maxdepth 1 ! -name '.git' ! -name '.' ! -name '..' -exec rm -rf {} \;
54+
# Remove old files (except .git and deploy.sh)
55+
find . -maxdepth 1 ! -name '.git' ! -name 'deploy.sh' ! -name '.' ! -name '..' -exec rm -rf {} \;
5656

5757
# Copy new site content
5858
cp -r "$TEMP_DIR"/* .

0 commit comments

Comments
 (0)