Skip to content

Commit

Permalink
Merge pull request #17143 from xiaods/master
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
openshift-merge-robot authored Nov 29, 2017
2 parents 8ab340a + 7250412 commit 32c11e8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion hack/lib/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ os::log::stacktrace::install
os::util::environment::update_path_var

if [[ -z "${OS_TMP_ENV_SET-}" ]]; then
os::util::environment::setup_tmpdir_vars "$( basename "$0" ".sh" )"
if [[ "$0" =~ *.sh ]]; then
os::util::environment::setup_tmpdir_vars "$( basename "$0" ".sh" )"
else
os::util::environment::setup_tmpdir_vars "shell"
fi
fi

# Allow setting $JUNIT_REPORT to toggle output behavior
Expand Down

0 comments on commit 32c11e8

Please sign in to comment.