Has anyone been able to call `kotlinc -script $som...
# getting-started
c
Has anyone been able to call
kotlinc -script $somePath
from shell in gradle? Here's what I'm trying to do
Copy code
task ensurePerformanceTestDevice(type: Exec) {
    def scriptsFolder = new File(projects.project.projectDir, "scripts")
    def environmentScript = new File(scriptsFolder, "device_check.kts")
    def scriptCall = "kotlinc -script \"$environmentScript\""
    println("Kotlinc device test command: \'$scriptCall\'")

    if (Os.isFamily(Os.FAMILY_WINDOWS)) {
        commandLine 'cmd', '/c', scriptCall
    } else {
        // maybe wrap it so it looks like only one arg?
        def unixCall = "\'$scriptCall\'"
        println("Unix call: $unixCall")
        commandLine 'sh', '-c', unixCall
    }
}
if I just take scriptCall and paste it into the terminal, it works, but for the
.sh
call I get exit value 127 back 😕: