Skip to content

Instantly share code, notes, and snippets.

@Arime9
Last active February 12, 2020 06:27
Show Gist options
  • Save Arime9/f05f780e378927bdca9f9470ac193772 to your computer and use it in GitHub Desktop.
Save Arime9/f05f780e378927bdca9f9470ac193772 to your computer and use it in GitHub Desktop.
Bash Pocket Reference
#!/bin/bash
# Case 1
# 実行結果を受け取り、失敗系のときは echo で出力する
set -e
# Anything
set +e
echo '$' "bundle install"
out=$(bundle install)
if [ $? != 0 ]; then
echo "bundle install failed"
echo $out
exit 1
fi
set -e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment