Skip to content

Instantly share code, notes, and snippets.

@hinovana
Created July 2, 2014 03:16
Show Gist options
  • Save hinovana/b26b963f26bfffeaebcf to your computer and use it in GitHub Desktop.
Save hinovana/b26b963f26bfffeaebcf to your computer and use it in GitHub Desktop.
コマンドの実行が終わったらYOをするシェルスクリプト
#!/bin/sh
#
# コマンドの実行が終わったらYOをするシェルスクリプト
#
# (1) APIユーザを作ってトークンを取得する
# http://yoapi.justyo.co/
#
# (2) APIユーザをフォローする
# APIユーザと普通のユーザは別なので気をつけて
#
# (3) コマンドを打つ
# YO_API_TOKEN=hogehoge yoall phpunit app/tests/functional/comments_test.php
#
# (4) YO!!
#
if test ${YO_API_TOKEN:-""} = ""
then
echo "usage:
YO_API_TOKEN={YOUR_YO_API_TOKEN} $0 EXEC_COMMAND"
exit -1
else
"$@"
curl http://api.justyo.co/yoall/ -X POST -d "api_token=${YO_API_TOKEN}" > /dev/null 2>&1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment