2021-01-10 20:56:52 +01:00
|
|
|
{ depot, pkgs, ... }:
|
|
|
|
let
|
|
|
|
bins = depot.nix.getBins pkgs.coreutils ["printf" "echo"];
|
|
|
|
|
|
|
|
debugExec = msg: depot.nix.writeExecline "debug-exec" {} [
|
|
|
|
"if" [
|
|
|
|
"fdmove" "-c" "1" "2"
|
|
|
|
"if" [ bins.printf "%s: " msg ]
|
|
|
|
"if" [ bins.echo "$@" ]
|
|
|
|
]
|
|
|
|
"$@"
|
|
|
|
];
|
|
|
|
|
|
|
|
eprintf = depot.nix.writeExecline "eprintf" {} [
|
2021-01-10 21:41:33 +01:00
|
|
|
"fdmove" "-c" "1" "2" bins.printf "$@"
|
2021-01-10 20:56:52 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
in {
|
|
|
|
inherit
|
|
|
|
debugExec
|
|
|
|
eprintf
|
|
|
|
;
|
|
|
|
}
|