]> gitweb @ CieloNegro.org - autobuild.git/blob - lib/run.bash
Split the script to several files.
[autobuild.git] / lib / run.bash
1 function run () {
2     if (( $# == 0 )); then
3         echo "run: Usage: run CMD [ARG...]" >&2
4         return 1
5     fi
6
7     # Is the /dev/stdout opened to a tty?
8     if [[ -t 1 ]]; then
9         # Bold + Green
10         echo -ne "\e[1;32m"
11         echo "$@"
12         echo -ne "\e[0m"
13     else
14         echo "$@"
15     fi
16
17     $@
18 }