Skip to content
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
2 changes: 1 addition & 1 deletion kscript
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jarPath=$(dirname $abs_kscript_path)/kscript.jar
if [[ $(uname) == CYGWIN* ]]; then jarPath=$(cygpath -w ${jarPath}); fi

## run it using command substitution to have just the user process once kscript is done
exec $(kotlin -classpath ${jarPath} kscript.app.KscriptKt "$@")
eval "exec $(kotlin -classpath ${jarPath} kscript.app.KscriptKt "$@")"
4 changes: 2 additions & 2 deletions src/main/kotlin/kscript/app/Kscript.kt
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ fun main(args: Array<String>) {
}


// print the final command to be run by exec
val joinedUserArgs = userArgs.joinToString(" ")
// print the final command to be run by eval+exec
val joinedUserArgs = userArgs.map { "\"${it.replace("\"", "\\\"")}\"" }.joinToString(" ")

//if requested try to package the into a standalone binary
if (docopt.getBoolean("package")) {
Expand Down