Ryan Brink
05/29/2023, 7:04 PMfun String.runCommand(workingDir: File): ProcessUtils.Result {
val parts = this.split("\\s".toRegex())
val proc = ProcessBuilder(parts)
.directory(workingDir)
.redirectOutput(ProcessBuilder.Redirect.PIPE)
.redirectError(ProcessBuilder.Redirect.PIPE)
.start()
proc.waitFor(60, TimeUnit.SECONDS)
val exitCode = proc.exitValue()
val outputText = proc.inputStream.bufferedReader().readText().trim()
return ProcessUtils.Result(exitCode, outputText)
}
I have confirmed that _workingDir.exists_() && _workingDir_._isDirectory_()
is true, but when the proc starts, it errors out with a dir not found error. Cannot fathom how the first statement can be true (confirmed dir does exist) but the proc cannot find it. My only guess is a permissions issue, but I cant find anything to confirm this is the case. Anyone have any ideas?Ryan Brink
05/29/2023, 7:16 PMerror=2, No such file or directory
... it's talking about the actual command