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

Fix argument passing in ash template #1334

Merged
merged 1 commit into from
May 4, 2020
Merged
Show file tree
Hide file tree
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 @@ -33,7 +33,7 @@ addJava () {
}

addResidual () {
residual_args="$residual_args $1"
residual_args="$residual_args \"$1\""
}

# Allow user to specify java options. These get listed first per bash-template.
Expand Down Expand Up @@ -107,4 +107,4 @@ java_cmd="$(get_java_cmd)"
# If a configuration file exist, read the contents to $opts
[ -f "$script_conf_file" ] && opts=$(loadConfigFile "$script_conf_file")

exec "$java_cmd" $java_opts -classpath $app_classpath $opts $app_mainclass "$residual_args"
eval "exec $java_cmd $java_opts -classpath $app_classpath $opts $app_mainclass $residual_args"
9 changes: 9 additions & 0 deletions src/sbt-test/ash/command-line-settings/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,12 @@ TaskKey[Unit]("checkResidual") := {
val output = (sys.process.Process(cmd, cwd).!!).replaceAll("\n", "")
assert(output.contains(arg), s"Application did not receive residual arg '$arg'")
}

TaskKey[Unit]("checkComplexResidual") := {
val args = """arg1 "arg 2" 'arg "3"'"""
val cwd = (stagingDirectory in Universal).value
val cmd = Seq((cwd / "bin" / packageName.value).getAbsolutePath, args)

val output = (sys.process.Process(cmd, cwd).!!).replaceAll("\n", "")
assert(output.contains(args), s"Application did not receive residual args '$args'")
}