kscripting / kscript

Scripting enhancements for Kotlin
MIT License
2.07k stars 125 forks source link

Support for running bash commands on Windows (via sh instead of bash) #331

Closed pmatysek closed 2 years ago

pmatysek commented 2 years ago

Kotlin was in my PATH, bu I was getting error [kscript] [ERROR] kotlinc is not in PATH. So I've made some investigation and testing. As I figured out problem was with bash -c command. For some reason it's not showing any output neither while running on my windows cmd nor from kscript. There wasn't any output even from simple echo. Fortunately I found that command sh -c is working perfectly. For that reason I wrote some piece of code which is choosing proper bash command for OS. However I'm not sure if problem is only in my enviroment (with git-bash instalation or some windows configuration?) or global for windows.

holgerbrandl commented 2 years ago

I have no issues running kscript on windows. Neither using Cmder nor git-bash. So I still feel unsure about the PR

aartiPl commented 2 years ago

The solution is now applied in similar form on kscript_4.1 branch. Closing this PR because of that.