Skip to content

Commit 98b2b5a

Browse files
committed
fix: Remove install script warning on Windows
Fixes #4226.
1 parent 72288c3 commit 98b2b5a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

cli/root.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"net/http"
99
"net/url"
1010
"os"
11+
"runtime"
1112
"strings"
1213
"text/template"
1314
"time"
@@ -565,7 +566,14 @@ func checkVersions(cmd *cobra.Command, client *codersdk.Client) error {
565566
}
566567

567568
fmtWarningText := `version mismatch: client %s, server %s
568-
download the server version with: 'curl -L https://coder.com/install.sh | sh -s -- --version %s'
569+
`
570+
if runtime.GOOS == "windows" {
571+
// We don't have a one-line install script for Windows.
572+
warn := cliui.Styles.Warn.Copy().Align(lipgloss.Left)
573+
_, _ = fmt.Fprintf(cmd.ErrOrStderr(), warn.Render(fmtWarningText), clientVersion, info.Version)
574+
return nil
575+
}
576+
fmtWarningText += `download the server version with: 'curl -L https://coder.com/install.sh | sh -s -- --version %s'
569577
`
570578

571579
if !buildinfo.VersionsMatch(clientVersion, info.Version) {

0 commit comments

Comments
 (0)