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

Windows generated script gives error #37

Closed
Chemmo opened this issue Jul 17, 2013 · 5 comments
Closed

Windows generated script gives error #37

Chemmo opened this issue Jul 17, 2013 · 5 comments

Comments

@Chemmo
Copy link

Chemmo commented Jul 17, 2013

I think the quoting is invalid in a generated windows batch script in 0.8.0. The line:

if "%MAINCLASS%"=="" ( echo 'This "start" script requires a main class name as the first argument, because a mainClass was not specified in SBT and not autodetected by SBT (usually means you have zero, or more than one, main classes). You could specify in your SBT build: mainClass in Compile := Some("Whatever")' && EXIT 1)

gives the error:

. was unexpected at this time.

If the single quotes are replaced by double quotes it works ok. I dont think using single quotes will treat special characters such as parenthesis as part of a character sequence, e.g.

C:>IF "a"=="a" (echo 'blah ("blah") blah' && echo blah)
blah' was unexpected at this time.

C:>IF "a"=="a" (echo "blah ("blah") blah" && echo blah)
'blah "blah" blah'
blah

@havocp
Copy link
Contributor

havocp commented Jul 17, 2013

@jchab - thoughts on the right fix?

@jchab
Copy link
Contributor

jchab commented Jul 17, 2013

I did some quick testing and it does look like switching the single quotes to double should fix the problem.

@havocp
Copy link
Contributor

havocp commented Jul 17, 2013

Thanks! @Chemmo do you want to make a pull request? I can do it "blind" (no Windows) but it might be nicer for someone with Windows to give it a shot and test it.

@Chemmo
Copy link
Author

Chemmo commented Jul 17, 2013

I just created a pull request, I'm fairly new to this so let me know if I did something wrong...#39. It seems to work ok, but all of the SbtStartScript.startScriptForX settings produce the same output as far as I can tell (I created a separate issue for this #38)

@Chemmo
Copy link
Author

Chemmo commented Aug 14, 2013

@havocp Can you please merge the pull request?
Thanks

@havocp havocp closed this as completed in a3e2521 Aug 14, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants