Skip to content

Commit 32c11e8

Browse files
Merge pull request #17143 from xiaods/master
Automatic merge from submit-queue (batch tested with PRs 17476, 17143, 15115, 17094, 17500). fix basename: illegal option -- b issue with upstream filenames starting with - issue: ``` $ git branch -vv * devel 3ea2451 Merge pull request #17120 from joelsmith/master master 3ae4430 [origin/master] fix basename: illegal option -- b issue with upstream filenames starting with - xiaods at XiaoTommydeMacBook-Pro in ~/go/src/github.com/openshift/origin on devel* $ export PATH="${PATH}:$( source hack/lib/init.sh; echo "${OS_OUTPUT_BINPATH}/$( os::build::host_platform )/" )" basename: illegal option -- b usage: basename string [suffix] basename [-a] [-s suffix] string [...] ``` caused by : The -- (dash dash) stops basename from processing any options in the argument. Always quote $0 in case there are spaces in the name.
2 parents 8ab340a + 7250412 commit 32c11e8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

hack/lib/init.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,11 @@ os::log::stacktrace::install
5151
os::util::environment::update_path_var
5252

5353
if [[ -z "${OS_TMP_ENV_SET-}" ]]; then
54-
os::util::environment::setup_tmpdir_vars "$( basename "$0" ".sh" )"
54+
if [[ "$0" =~ *.sh ]]; then
55+
os::util::environment::setup_tmpdir_vars "$( basename "$0" ".sh" )"
56+
else
57+
os::util::environment::setup_tmpdir_vars "shell"
58+
fi
5559
fi
5660

5761
# Allow setting $JUNIT_REPORT to toggle output behavior

0 commit comments

Comments
 (0)