all repos — dotfiles @ d032a1af326893bb3e399edbb9cd50fabfa31d2e

linux dotfiles

bin/misc/update_gist

#!/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 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'\
    -d@payload\
    https://api.github.com/gists/c1b86bac8046770f8718d60e120f92ea > /dev/null 2>&1

rm payload content
fi