mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-26 08:53:21 +00:00
34 lines
802 B
Nix
34 lines
802 B
Nix
|
{ lib }:
|
||
|
{
|
||
|
echo_build_heading = colors: ''
|
||
|
echo_build_heading() {
|
||
|
start=""
|
||
|
end=""
|
||
|
${lib.optionalString (colors == "always") ''
|
||
|
start="$(printf '\033[0;1;32m')" #set bold, and set green.
|
||
|
end="$(printf '\033[0m')" #returns to "normal"
|
||
|
''}
|
||
|
if (( $# == 1 )); then
|
||
|
echo "$start""Building $1""$end"
|
||
|
else
|
||
|
echo "$start""Building $1 ($2)""$end"
|
||
|
fi
|
||
|
}
|
||
|
'';
|
||
|
noisily = colors: verbose: ''
|
||
|
noisily() {
|
||
|
start=""
|
||
|
end=""
|
||
|
${lib.optionalString (colors == "always") ''
|
||
|
start="$(printf '\033[0;1;32m')" #set bold, and set green.
|
||
|
end="$(printf '\033[0m')" #returns to "normal"
|
||
|
''}
|
||
|
${lib.optionalString verbose ''
|
||
|
echo -n "$start"Running "$end"
|
||
|
echo $@
|
||
|
''}
|
||
|
$@
|
||
|
}
|
||
|
'';
|
||
|
}
|