Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for local untracked files when deploying #168

Merged
merged 4 commits into from
Jan 5, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions bin/deploy
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@ if ! git diff-index --quiet HEAD --; then
[[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi

# Check if there are any untracked files
u="$(git ls-files --exclude-standard --others)"
if ! test -z "$u"; then
LoryPack marked this conversation as resolved.
Show resolved Hide resolved
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