mirror of
https://github.com/notwa/rc
synced 2024-06-26 09:07:12 -07:00
better error handling
This commit is contained in:
parent
5ce9a3f562
commit
ca62d43d88
|
@ -31,7 +31,7 @@ mkgist() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# TODO: sanitize $desc
|
# TODO: sanitize $desc
|
||||||
curl 'https://api.github.com/gists' -sid@- -H "$head" -o "$rf" << EOF
|
curl 'https://api.github.com/gists' -sSid@- -H "$head" -o "$rf" << EOF
|
||||||
{
|
{
|
||||||
"description": "$desc",
|
"description": "$desc",
|
||||||
"public": $public,
|
"public": $public,
|
||||||
|
@ -41,6 +41,7 @@ EOF
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
rm "$rf"
|
rm "$rf"
|
||||||
|
echo failed to POST to github >&2
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user