Avoid use of subshell in whitely/greyly
This commit is contained in:
1 parent
f3619367a2
commit
5e01021cba
1 file changed
+11
-2
+11
-2
@@ -35,12 +35,21 @@ remote() {
|
|||||||
$@ > >(while read line; do echo -e "\e[0;34m$rem>\e[0m $line"; done)
|
$@ > >(while read line; do echo -e "\e[0;34m$rem>\e[0m $line"; done)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
colourise() {
|
||||||
|
echo -ne '\e['$1'm'
|
||||||
|
shift
|
||||||
|
# It's important that we don't do this in a subshell, as some
|
||||||
|
# commands we execute need to modify global state
|
||||||
|
"$@"
|
||||||
|
echo -ne '\e[0m'
|
||||||
|
}
|
||||||
|
|
||||||
whitely() {
|
whitely() {
|
||||||
echo -e '\e[1;37m'`$@`'\e[0m'
|
colourise '1;37' "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
greyly () {
|
greyly () {
|
||||||
echo -e '\e[0;37m'`$@`'\e[0m'
|
colourise '0;37' "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
run_on() {
|
run_on() {
|
||||||
|
|||||||
Reference in new issue
Block a user