Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions bin/bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ warn() {
}

stop() {
warn $@
warn "$@"
exit 1
}

Expand Down Expand Up @@ -103,7 +103,11 @@ process_options() {
-p) shift
PREFIX="$1";;
-p=*|--prefix=*)
PREFIX=`eval echo $flag_arg`;; # no quotes so ~ gets expanded (issue #412)
case "$flag_arg" in
"~") PREFIX="$HOME" ;;
"~/"*) PREFIX="$HOME/${flag_arg#~/}" ;;
*) PREFIX="$flag_arg" ;;
esac;;
-h|--help|-\?|help|\?)
MODE="help";;
*) case "$flag" in
Expand Down Expand Up @@ -139,7 +143,7 @@ download_file() { # <url|file> <destination file>
fi;;
*)
info "Copying: $1"
if ! cp $1 $2 ; then
if ! cp "$1" "$2" ; then
stop "Unable to copy from $1"
fi;;
esac
Expand Down Expand Up @@ -220,7 +224,7 @@ main_help() {
main_start() {
detect_osarch
detect_git_tag
process_options $@
process_options "$@"
if [ "$MODE" = "help" ] ; then
main_help
else
Expand All @@ -229,4 +233,4 @@ main_start() {
}

# note: only start executing commands now to guard against partial downloads
main_start $@
main_start "$@"