Closed SpectatorNan closed 2 years ago
It looks like docker
command path is not in the PATH
env variable when running the app.
It looks like
docker
command path is not in thePATH
env variable when running the app.
I don't know if this is because of permission issues or if this app needs to import system environment variables
This app is a CI and code generation tool. Some operational behaviors depend on other tools, such as docker, go, etc.
The reason is that the path in the APP environment variable is different from the path in the system.
static func startLoadEnv() {
let userHomePath = EnviromentUtils.userHomeDirPath
let goOutput = SwiftShell.run(bash: "source \(userHomePath)/.zshrc ; echo $PATH")
var env = SwiftShell.main.env
env["PATH"] = "\(goOutput.stdout):/usr/local/bin"
SwiftShell.main.env = env
}
This method can be called when the APP starts to solve this problem
Excellent, glad it is working now.
i create a mac app. and i run shell which docker. it return stdout is empty string this code run.