Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let bash-template work when the directory contains spaces. #267

Merged
merged 1 commit into from
Jun 6, 2014
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ realpath () {
TARGET_FILE="$1"
CHECK_CYGWIN="$2"

cd $(dirname "$TARGET_FILE")
cd "$(dirname "$TARGET_FILE")"
TARGET_FILE=$(basename "$TARGET_FILE")

COUNT=0
while [ -L "$TARGET_FILE" -a $COUNT -lt 100 ]
do
TARGET_FILE=$(readlink "$TARGET_FILE")
cd $(dirname "$TARGET_FILE")
cd "$(dirname "$TARGET_FILE")"
TARGET_FILE=$(basename "$TARGET_FILE")
COUNT=$(($COUNT + 1))
done
Expand Down Expand Up @@ -132,18 +132,19 @@ execRunner () {
}
addJava () {
dlog "[addJava] arg = '$1'"
java_args=( "${java_args[@]}" "$1" )
java_args+=( "$1" )
}
addApp () {
dlog "[addApp] arg = '$1'"
app_commands=( "${app_commands[@]}" "$1" )
app_commands+=( "$1" )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know which version of BASH this is supported in?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could just be my ignorance :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, good question. From the Bash changelog it looks to me like it might have been added in 3.1. Is that old enough? Maybe.

Sorry about these mostly unrelated changes. I was trying to figure out why the space in -Duser.dir= was causing problems, and I was hoping these would help, but they did not. (I'm not very good with Bash.) In the end the fix was c132333 — your change, that I did not have.

Let me know if you would prefer these += diffs reverted!

}
addResidual () {
dlog "[residual] arg = '$1'"
residual_args=( "${residual_args[@]}" "$1" )
residual_args+=( "$1" )
}
addDebugger () {
addJava "-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=$1"
addJava "-Xdebug"
addJava "-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=$1"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

}
# a ham-fisted attempt to move some memory settings in concert
# so they need not be messed around with individually.
Expand Down