Skip to content

Commit

Permalink
Check if the index file should be backup
Browse files Browse the repository at this point in the history
  • Loading branch information
johngrib committed Nov 30, 2019
1 parent e89379b commit e4937fb
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion bin/droller
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,18 @@ backup() {
printf "Backup requires git. Please install git.\nBackup has been canceled.\n"
return 1
fi
if [ `isNeedBackup` == "0" ]; then
echo "There are no changes. You do not need to back up."
gitLog
return 0
fi
gitInit
gitCommit
gitLog | head
gitLog
}

isNeedBackup() {
git -C $DIRECTORY status --short | grep -v '??' | wc -l | tr -d ' '
}

gitInit() {
Expand Down

0 comments on commit e4937fb

Please sign in to comment.