@@ -835,14 +835,14 @@ func (r *RootCmd) checkVersions(i *clibase.Invocation, client *codersdk.Client,
835
835
}
836
836
837
837
if ! buildinfo .VersionsMatch (clientVersion , serverInfo .Version ) {
838
- upgradeMessage := defaultUpgradeMessage ()
838
+ upgradeMessage := defaultUpgradeMessage (strings . TrimPrefix ( serverInfo . CanonicalVersion (), "v" ) )
839
839
if serverInfo .UpgradeMessage != "" {
840
840
upgradeMessage = serverInfo .UpgradeMessage
841
841
}
842
842
843
843
fmtWarningText := "version mismatch: client %s, server %s\n %s"
844
844
fmtWarn := pretty .Sprint (cliui .DefaultStyles .Warn , fmtWarningText )
845
- warning := fmt .Sprintf (fmtWarn , clientVersion , strings . TrimPrefix ( serverInfo .CanonicalVersion (), "v" ) , upgradeMessage )
845
+ warning := fmt .Sprintf (fmtWarn , clientVersion , serverInfo .Version , upgradeMessage )
846
846
847
847
_ , _ = fmt .Fprint (i .Stderr , warning )
848
848
_ , _ = fmt .Fprintln (i .Stderr )
@@ -1218,12 +1218,11 @@ func SlimUnsupported(w io.Writer, cmd string) {
1218
1218
os .Exit (1 )
1219
1219
}
1220
1220
1221
- func defaultUpgradeMessage () string {
1221
+ func defaultUpgradeMessage (serverVersion string ) string {
1222
1222
// Our installation script doesn't work on Windows, so instead we direct the user
1223
1223
// to the GitHub release page to download the latest installer.
1224
- version := buildinfo .Version ()
1225
1224
if runtime .GOOS == "windows" {
1226
- return fmt .Sprintf ("download the server version from: https://github.com/coder/coder/releases/v%s" , version )
1225
+ return fmt .Sprintf ("download the server version from: https://github.com/coder/coder/releases/v%s" , serverVersion )
1227
1226
}
1228
- return fmt .Sprintf ("download the server version with: 'curl -L https://coder.com/install.sh | sh -s -- --version %s'" , version )
1227
+ return fmt .Sprintf ("download the server version with: 'curl -L https://coder.com/install.sh | sh -s -- --version %s'" , serverVersion )
1229
1228
}
0 commit comments