Check for local untracked files when deploying (#168)

* Check for local untracked files when deploying

* Compress test for untracked files to 1 line

Co-authored-by: Maruan <alshedivat@users.noreply.github.com>

* Add vendor to .gitignore

* Add .bundle to .gitignore

Co-authored-by: Maruan Al-Shedivat <alshedivat.maruan@gmail.com>
This commit is contained in:
Lorenzo Pacchiardi 2021-01-05 16:04:18 +01:00 committed by GitHub
parent c4be6f8457
commit e2353bcc8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

2
.gitignore vendored
View File

@ -1,7 +1,9 @@
_site
.bundle
.sass-cache
.jekyll-metadata
.DS_store
.ruby-version
.tweet-cache/
Gemfile.lock
vendor

View File

@ -67,6 +67,15 @@ if ! git diff-index --quiet HEAD --; then
[[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi
# Check if there are any untracked files
if ! test -z "$(git ls-files --exclude-standard --others)"; then
echo "There are untracked files:"
git ls-files --exclude-standard --others
echo "Please commit those files or stash them before proceeding."
echo "Aborting."
[[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi
# Switch to source branch (creates it if necessary from the current branch)
if [ `git branch | grep $SRC_BRANCH | tr ' ' '\n' | tail -1` ]
then