Skip to content

Commit

Permalink
fix basename: illegal option -- b issue with upstream filenames start…
Browse files Browse the repository at this point in the history
…ing with -

issue:
```
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
xiaods committed Nov 2, 2017
1 parent ea8f407 commit 3ae4430
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hack/lib/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ 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" )"
os::util::environment::setup_tmpdir_vars "$( basename -- "$0" ".sh" )"
fi

# Allow setting $JUNIT_REPORT to toggle output behavior
Expand Down

0 comments on commit 3ae4430

Please sign in to comment.