Skip to content

cygwin support improvements - #175

Merged
holgerbrandl merged 2 commits into
kscripting:masterfrom
vehovsky:cygwin-support
Oct 16, 2018
Merged

holgerbrandl merged 2 commits into
kscripting:masterfrom
vehovsky:cygwin-support

Conversation

@vehovsky

Copy link
Copy Markdown

Currently kscript is not working on Windows in cygwin.

/cygdrive/c/kotlin/scripting
$ kscript 'println("hello world")'
error: please specify at least one name or file to run

Most of the issues were caused by not quoting paths containing windows path separator '' that was actually escaping characters in cygwin.

The '--package' didn't work for similar reason. In the generated gradle build file the actual script was added with windows path separators ''. Now using invariant separator '/'.

@holgerbrandl

Copy link
Copy Markdown
Collaborator

Looks like a great PR, thanks for contributing. Could you merge-in my typo fix of the build-file, to make sure that the tests are still fine.

 - quote paths containing windows path separator '\' that was causing escaping characters in cygwin
 - use invariant separator '/' when generating gradle file for '--package'
@vehovsky

Copy link
Copy Markdown
Author

Hi @holgerbrandl sure it's done.

3 tests are failing. But those tests are failing for me on master locally even without any changes.

Could you have a look at those 3 tests?

Thanks

@holgerbrandl
holgerbrandl merged commit 5b436c7 into kscripting:master Oct 16, 2018
@holgerbrandl

Copy link
Copy Markdown
Collaborator

I've adjusted the tests to cope with the additional quoting in a separate branch pr175 (see link above in this thread).

I've also merged in PR although I realized afterwards, that it seems to break the packaging by not setting the executable flag on the packaged script. See https://travis-ci.org/holgerbrandl/kscript/builds/442050672
I like the simplified usage of reallyExecutable but we may need to set the +x manually now or roll it back I guess.

@vehovsky

Copy link
Copy Markdown
Author

You are right, I also noticed yesterday, but forgot to fix it. Can you please just change

AppHelpers.kt

File(tmpProjectDir, "build/libs/${appName}").copyTo(pckgedJar, true)

to:

File(tmpProjectDir, "build/libs/${appName}").copyTo(pckgedJar, true).setExecutable(true)

@holgerbrandl

Copy link
Copy Markdown
Collaborator

All tests are green again. :-) Thanks for contributing to kscript!

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

Successfully merging this pull request may close these issues.

2 participants