Skip to content

Commit

Permalink
Initialize Git if .git does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
asbjornu committed May 18, 2020
1 parent 397a774 commit b0a7514
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ main() {

enable_expanded_output

# Initialize Git if there's no .git folder
if [[ ! -d ".git" ]]; then
git init
set_user_id
git add --all .
git commit --message 'Initial commit'
fi

if ! git diff --exit-code --quiet --cached; then
echo Aborting due to uncommitted changes in the index >&2
return 1
Expand Down

0 comments on commit b0a7514

Please sign in to comment.