summaryrefslogtreecommitdiffstats
path: root/nix-utils.sh
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2015-06-28 15:22:00 +0200
committerMatthias Beyer <mail@beyermatthias.de>2015-09-07 16:11:45 +0200
commit80bc48e7440c046f11acba98401f73616172bd1a (patch)
treeb3fc995d5f6372ab6711aae9d5e27440ee5d6ba7 /nix-utils.sh
parentbd75f32309dbaed6f4266056f186c34d3d19d8f9 (diff)
Rewrite scriptname_to_command helper function
Diffstat (limited to 'nix-utils.sh')
-rw-r--r--nix-utils.sh3
1 files changed, 1 insertions, 2 deletions
diff --git a/nix-utils.sh b/nix-utils.sh
index 9e0a070..1aa35c5 100644
--- a/nix-utils.sh
+++ b/nix-utils.sh
@@ -31,8 +31,7 @@ stdout() {
# Get the command name from a script path
#
scriptname_to_command() {
- echo "$1" | sed 's,^\.\/nix-script-,,' | sed 's,\.sh$,,' | \
- sed -r "s,$(dirname ${BASH_SOURCE[0]})/nix-script-,,"
+ echo "$1" | sed -r "s,$(dirname ${BASH_SOURCE[0]})/$2-(.*)\.sh$,\1,"
}
#