Skip to content
This repository was archived by the owner on Oct 11, 2025. It is now read-only.

Commit 2e53519

Browse files
author
Micah Young
committed
Fixes for zsh
1 parent 1e56885 commit 2e53519

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

src/bosh-vmrun-cpi/install/install_cpi.go

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,16 @@ func compareCPIVersionsSSH(version, cpiSrcPath, cpiDestPath string, client *ssh.
7070
logger.Debug("install-cpi", "comparison error: %s output: %s", err.Error(), string(cpiVersionOutputBytes))
7171
}
7272

73-
if strings.Contains(string(cpiVersionOutput), "The system cannot find the path specified") {
74-
return false, nil
75-
}
76-
77-
if strings.Contains(string(cpiVersionOutput), "is not recognized as an internal or external command") {
78-
return false, nil
79-
}
80-
81-
if strings.Contains(string(cpiVersionOutput), "No such file or directory") {
82-
return false, nil
83-
}
73+
notFoundErrorMsgs := []string{
74+
"the system cannot find the path specified",
75+
"is not recognized as an internal or external command",
76+
"no such file or directory",
77+
}
78+
for _, msg := range notFoundErrorMsgs {
79+
if strings.Contains(strings.ToLower(string(cpiVersionOutput)), msg) {
80+
return false, nil
81+
}
82+
}
8483

8584
if err != nil {
8685
return false, fmt.Errorf("Error: %s; Output: %s", err.Error(), cpiVersionOutput)

0 commit comments

Comments
 (0)