Skip to content

Commit

Permalink
Check for local untracked files when deploying (#168)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
Lorenzo Pacchiardi and alshedivat committed Jan 5, 2021
1 parent c4be6f8 commit e2353bc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
_site
.bundle
.sass-cache
.jekyll-metadata
.DS_store
.ruby-version
.tweet-cache/
Gemfile.lock
vendor
9 changes: 9 additions & 0 deletions bin/deploy
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e2353bc

Please sign in to comment.