diff options
author | typebrook <typebrook@gmail.com> | 2020-01-29 01:19:01 +0800 |
---|---|---|
committer | typebrook <typebrook@gmail.com> | 2020-01-29 01:19:01 +0800 |
commit | 8e32cb58c9decd74d6a91b67c9bee7f960bda6c6 (patch) | |
tree | 136976cc63005705b2afe699ff2d2e78ff097ff1 /scripts/gist | |
parent | a7638108082c68ef5ed7c6370d7403937780e343 (diff) |
update
Diffstat (limited to 'scripts/gist')
-rwxr-xr-x | scripts/gist | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/scripts/gist b/scripts/gist index 09d67c0..57da470 100755 --- a/scripts/gist +++ b/scripts/gist | |||
@@ -284,8 +284,7 @@ _create_gist() { | |||
284 | [[ -z "$description" ]] && read -p 'Type description: ' description < /dev/tty | 284 | [[ -z "$description" ]] && read -p 'Type description: ' description < /dev/tty |
285 | 285 | ||
286 | for file in $files; do | 286 | for file in $files; do |
287 | filename=$(basename $file) | 287 | echo "\"$(basename $file)\": {\"content\": \"$(sed '$ !s/$/\\n/' $file)\"}," |
288 | echo "\"$filename\": {\"content\": \"$(sed '$ !s/$/\\n/' $file)\"}," | ||
289 | done | tr -d '\n' | sed 's/^/{/; s/,$/}/' \ | 288 | done | tr -d '\n' | sed 's/^/{/; s/,$/}/' \ |
290 | | echo "{ \"public\": true, \"files\": $(cat -), \"description\": \"$description\"}" \ | 289 | | echo "{ \"public\": true, \"files\": $(cat -), \"description\": \"$description\"}" \ |
291 | | curl -s -H "$auth_header" --data @- $github_api/gists \ | 290 | | curl -s -H "$auth_header" --data @- $github_api/gists \ |