mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-11-09 20:44:03 -08:00
fix(cmd): only fetch =ExitCode on no status
This commit is contained in:
parent
1bdc22bf40
commit
d588965e50
|
@ -630,15 +630,13 @@ func (env *Shell) HasCommand(command string) bool {
|
|||
func (env *Shell) StatusCodes() (int, string) {
|
||||
defer env.Trace(time.Now())
|
||||
|
||||
if env.CmdFlags.Shell != CMD || env.CmdFlags.ErrorCode == 0 {
|
||||
if env.CmdFlags.Shell != CMD || !env.CmdFlags.NoExitCode {
|
||||
return env.CmdFlags.ErrorCode, env.CmdFlags.PipeStatus
|
||||
}
|
||||
|
||||
errorCode := env.Getenv("=ExitCode")
|
||||
if len(errorCode) > 0 {
|
||||
env.Debug(errorCode)
|
||||
env.CmdFlags.ErrorCode, _ = strconv.Atoi(errorCode)
|
||||
}
|
||||
env.Debug(errorCode)
|
||||
env.CmdFlags.ErrorCode, _ = strconv.Atoi(errorCode)
|
||||
|
||||
return env.CmdFlags.ErrorCode, env.CmdFlags.PipeStatus
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue