mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-19 08:53:30 +02:00
27 lines
593 B
Bash
27 lines
593 B
Bash
error() {
|
|
echo " ! $*" >&2
|
|
exit 1
|
|
}
|
|
|
|
status() {
|
|
echo "-----> $*"
|
|
}
|
|
|
|
protip() {
|
|
echo
|
|
echo "PRO TIP: $*" | indent
|
|
echo "See https://devcenter.heroku.com/articles/nodejs-support" | indent
|
|
echo
|
|
}
|
|
|
|
# sed -l basically makes sed replace and buffer through stdin to stdout
|
|
# so you get updates while the command runs and dont wait for the end
|
|
# e.g. npm install | indent
|
|
indent() {
|
|
c='s/^/ /'
|
|
case $(uname) in
|
|
Darwin) sed -l "$c";; # mac/bsd sed: -l buffers on line boundaries
|
|
*) sed -u "$c";; # unix/gnu sed: -u unbuffered (arbitrary) chunks of data
|
|
esac
|
|
}
|