add update_gist script and passmenu
Prithu Goswami prithugoswami524@gmail.com
Fri, 10 Jul 2020 22:22:12 +0530
2 files changed,
50 insertions(+),
0 deletions(-)
A
bin/misc/update_gist
@@ -0,0 +1,25 @@
+#!/bin/sh + +if [ "$1" ] +then +cat "$1" | sed ':a;N;$!ba;s/\n/\\n/g' | sed 's/"/\\"/g' > content + +cat <<EOF > payload +{ + "description": "REST API docs for LMM Counsellor App", + "files": { + "REST API Counsellor.md": { + "content": "`cat content`", + "filename": "REST API Counsellor.md" + } + } +} +EOF + +curl -s -X PATCH\ + -H 'Authorization: token f9586f6dde6425d3e41569e1e6bf721b1abe4c4e'\ + -d@payload\ + https://api.github.com/gists/c1b86bac8046770f8718d60e120f92ea > /dev/null 2>&1 + +rm payload content +fi