Commit 501855c9 by Mislav Marohnić

Fix stubbing programs that have dashes in them

parent 24ff49cc
...@@ -3,7 +3,7 @@ set -e ...@@ -3,7 +3,7 @@ set -e
status=0 status=0
program="${0##*/}" program="${0##*/}"
PROGRAM="$(echo "$program" | tr a-z A-Z)" PROGRAM="$(echo "$program" | tr a-z- A-Z_)"
[ -n "$TMPDIR" ] || TMPDIR="/tmp" [ -n "$TMPDIR" ] || TMPDIR="/tmp"
_STUB_PLAN="${PROGRAM}_STUB_PLAN" _STUB_PLAN="${PROGRAM}_STUB_PLAN"
......
...@@ -15,7 +15,7 @@ teardown() { ...@@ -15,7 +15,7 @@ teardown() {
stub() { stub() {
local program="$1" local program="$1"
local prefix="$(echo "$program" | tr a-z A-Z)" local prefix="$(echo "$program" | tr a-z- A-Z_)"
shift shift
export "${prefix}_STUB_PLAN"="${TMP}/${program}-stub-plan" export "${prefix}_STUB_PLAN"="${TMP}/${program}-stub-plan"
...@@ -31,7 +31,7 @@ stub() { ...@@ -31,7 +31,7 @@ stub() {
unstub() { unstub() {
local program="$1" local program="$1"
local prefix="$(echo "$program" | tr a-z A-Z)" local prefix="$(echo "$program" | tr a-z- A-Z_)"
local path="${TMP}/bin/${program}" local path="${TMP}/bin/${program}"
export "${prefix}_STUB_END"=1 export "${prefix}_STUB_END"=1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment