diff options
author | typebrook <typebrook@gmail.com> | 2020-03-29 23:21:23 +0800 |
---|---|---|
committer | typebrook <typebrook@gmail.com> | 2020-03-29 23:21:23 +0800 |
commit | 5bef750938b17adaf8a89e3e6c110a7480848832 (patch) | |
tree | 9badde78d37500590947256f0440b79a24726f7e | |
parent | 5e23f321695feb299883bebfc61b3b55a3a52071 (diff) |
update
-rwxr-xr-x | tools/misc/sync-gist.sh | 18 |
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 | |||
3 | set -o pipefail | ||
4 | set -e | ||
5 | |||
6 | repo=~/gist/b0d2e7e67aa50298fdf8111ae7466b56 | ||
7 | |||
8 | while 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" | ||
17 | done | ||
18 | |||