Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8e702d8

Browse files
fix: improve the warning mismatch to display the release assets on windows (#5418)
* fix: improve the warning mismatch to display the release assets on windowsFixes#4226.* Update cli/root.goCo-authored-by: Mathias Fredriksson <mafredri@gmail.com>* Update cli/root.goCo-authored-by: Mathias Fredriksson <mafredri@gmail.com>Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
1 parentb103685 commit8e702d8

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

‎cli/root.go

Lines changed: 8 additions & 2 deletions
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"
@@ -583,12 +584,17 @@ func checkVersions(cmd *cobra.Command, client *codersdk.Client) error {
583584
}
584585

585586
fmtWarningText:=`version mismatch: client %s, server %s
586-
download the server version with: 'curl -L https://coder.com/install.sh | sh -s -- --version %s'
587587
`
588+
// Our installation script doesn't work on Windows, so instead we direct the user
589+
// to the GitHub release page to download the latest installer.
590+
ifruntime.GOOS=="windows" {
591+
fmtWarningText+=`download the server version from: https://github.com/coder/coder/releases/v%s`
592+
}else {
593+
fmtWarningText+=`download the server version with: 'curl -L https://coder.com/install.sh | sh -s -- --version %s'`
594+
}
588595

589596
if!buildinfo.VersionsMatch(clientVersion,info.Version) {
590597
warn:=cliui.Styles.Warn.Copy().Align(lipgloss.Left)
591-
// Trim the leading 'v', our install.sh script does not handle this case well.
592598
_,_=fmt.Fprintf(cmd.ErrOrStderr(),warn.Render(fmtWarningText),clientVersion,info.Version,strings.TrimPrefix(info.CanonicalVersion(),"v"))
593599
_,_=fmt.Fprintln(cmd.ErrOrStderr())
594600
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp