Created
February 22, 2017 07:13
-
-
Save inakagawa/a0bc48e38c0c0ff32c7685f3968f113e to your computer and use it in GitHub Desktop.
gistに投稿した後、アップデートするためのシェルスクリプトを同じdirに書き出す
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# シェルスクリプト関数として .bashrc などに書いてもよい | |
function gist-here () { | |
if [ $# -ne 1 ]; then | |
echo 'gist_here [FILENAME]' | |
echo ' to post the file, clip its URL.' | |
exit 1 | |
fi | |
url=`gist $1` | |
echo '#!/bin/bash' > gist-update.sh | |
echo "gist -u $url $1" >> gist-update.sh | |
echo "gist url: $url" | |
echo $url | pbcopy | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
こういうことをしなくても、gistコマンドのオプションでどうにかなりそうな気はする