summaryrefslogtreecommitdiffstats
path: root/nix-utils.sh
diff options
context:
space:
mode:
Diffstat (limited to 'nix-utils.sh')
-rw-r--r--nix-utils.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/nix-utils.sh b/nix-utils.sh
index b21c4ab..382763f 100644
--- a/nix-utils.sh
+++ b/nix-utils.sh
@@ -31,7 +31,8 @@ stdout() {
# Get the command name from a script path
#
scriptname_to_command() {
- echo "$1" | sed -r "s,$(dirname ${BASH_SOURCE[0]})/$2-(.*)\.sh$,\1,"
+ callee=$([ -z "$2" ] && echo "nix-script" || echo "$2")
+ echo "$1" | sed -r "s,$(dirname ${BASH_SOURCE[0]})/$callee-(.*)\.sh$,\1,"
}
#