Raynes / lein-bin

Standalone console executables for your project.
155 stars 19 forks source link

Improve quoting in the preamble. #25

Open jacobmorzinski opened 8 years ago

jacobmorzinski commented 8 years ago

On Unix, use double quotes around "$0" to protect against the case where the script may have spaces in its name.

On Windows, the name of the batch file is in variable %0, available as "%~f0" for a quoted fully-qualified path. The variable %1 is the first commandline arg, and is not the right variable for -jar or -Xbootclasspath . This patch puts "%~f0" into the right places and removes %1 as needed.

Enhancement: for such a short preamble, putting "@echo off" is minor overkill - it is simpler to just have a "@" at the start of the "java" and "goto" lines.

jacobmorzinski commented 8 years ago

This pull request is supposed to help with issue #24 I've tested it on Windows 10 and Ubuntu Linux, and it works for me on both.