Skip to content

Commit

Permalink
sync_gist(): skip sync dirty repos, warn instead.
Browse files Browse the repository at this point in the history
  • Loading branch information
weakish committed Oct 25, 2016
1 parent f228df6 commit 6ffeaa4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ After that, you may run `gister sync` to fetch all your gists to local.

Warn: `sync` can only fetch up to 10 million gists for you. If you have more than 10 million gists, you need to modify the source of `gister` yourself.

Also note that `gister sync` will not sync dirty repos.
It will gives a warning on the stdout.

### publish

Expand Down
6 changes: 5 additions & 1 deletion gister.sh
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,11 @@ sync_gist() {
if test $time_difference_abs -le 6; then
echo "[x] $gist_id"
else
git pull && git push
if [ $(git status --porcelain | wc -l) -eq 0 ]; then # clean
git pull && git push
else # dirty
echo "DIRTY $gist_id"
fi
fi
else
cd $gisthome/tree
Expand Down

0 comments on commit 6ffeaa4

Please sign in to comment.