aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authortypebrook <typebrook@gmail.com>2020-03-29 23:21:23 +0800
committertypebrook <typebrook@gmail.com>2020-03-29 23:21:23 +0800
commit5bef750938b17adaf8a89e3e6c110a7480848832 (patch)
tree9badde78d37500590947256f0440b79a24726f7e
parent5e23f321695feb299883bebfc61b3b55a3a52071 (diff)
update
-rwxr-xr-xtools/misc/sync-gist.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/misc/sync-gist.sh b/tools/misc/sync-gist.sh
new file mode 100755
index 0000000..54fa4fe
--- /dev/null
+++ b/tools/misc/sync-gist.sh
@@ -0,0 +1,18 @@
1#! /bin/bash
2
3set -o pipefail
4set -e
5
6repo=~/gist/b0d2e7e67aa50298fdf8111ae7466b56
7
8while read -r commit; do
9
10 cd $repo
11 git checkout $commit
12 message="$(git show $commit | sed -n '1,4 d; /^diff/ q; s/^ //p')"
13
14 cd ~/git/Bash-Snippets
15 cp $repo/gist gist/gist
16 git add gist/gist && git commit -m "$message"
17done
18