Skip to content

Commit d8d6e05

Browse files
committed
extension/tools/release: fix errors in checkPackageJSON
The version in package.json and the version in tag should match. The check was reversed. And fix the error message about the missing environment variable. Change-Id: I945a9a5f678d9bf9762a2e754db5fe3f54c433c7 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/606777 Reviewed-by: Hongxiang Jiang <[email protected]> Commit-Queue: Hyang-Ah Hana Kim <[email protected]> kokoro-CI: kokoro <[email protected]>
1 parent 25fd122 commit d8d6e05

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

extension/tools/release/release.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ func requireTools(tools ...string) {
275275
func requireEnv(name string) string {
276276
v := os.Getenv(name)
277277
if v == "" {
278-
fatalf("required environment variable %q not set", v)
278+
fatalf("required environment variable %q not set", name)
279279
}
280280
return v
281281
}
@@ -354,7 +354,7 @@ func checkPackageJSON(tagName string, isPrerelease bool) {
354354
}
355355
// Check only major.minor for prerelease.
356356
major, minor, _, _ := parseVersionTagName(tagName)
357-
if want := fmt.Sprintf("%d.%d.", major, minor); strings.HasPrefix(versionInPackageJSON, want) {
357+
if want := fmt.Sprintf("%d.%d.", major, minor); !strings.HasPrefix(versionInPackageJSON, want) {
358358
fatalf("package.json version %q does not match wanted string %q", versionInPackageJSON, want)
359359
}
360360
}

0 commit comments

Comments
 (0)