aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authortypebrook <typebrook@gmail.com>2020-03-17 09:29:29 +0800
committertypebrook <typebrook@gmail.com>2020-03-17 09:35:33 +0800
commit34ffd215585c483c32fbd53c6b7be4645c902963 (patch)
tree11058a624fa352e8f17a5c591fd8767338587eaf
parent71ab694bb824f0b3305f72ce14e3f30826bb7250 (diff)
Improve 'gist push'
Allow empty index if user is already inside repo
-rwxr-xr-xgist8
1 files changed, 5 insertions, 3 deletions
diff --git a/gist b/gist
index df3c631..5d06ec8 100755
--- a/gist
+++ b/gist
@@ -508,9 +508,11 @@ _import_to_github() {
508 508
509# Simply commit current changes and push to remote 509# Simply commit current changes and push to remote
510_push_to_remote() { 510_push_to_remote() {
511 _gist_id "$1" || return 1 511 if [[ ! `pwd` =~ ^$folder/[0-9a-z]+$ ]]; then
512 cd "$folder/$GIST_ID" && git add . \ 512 _gist_id "$1"
513 && git commit --allow-empty-message -m '' && git push origin master 513 cd "$folder/$GIST_ID" || return 1
514 fi
515 git add . && git commit -m 'update' && git push origin master
514} 516}
515 517
516# Set filename/description/permission for a new gist 518# Set filename/description/permission for a new gist