Skip to content

Commit

Permalink
fix: Detect git version on windows
Browse files Browse the repository at this point in the history
git does not fully match semver, especially on the windows version.
Using loose checking in findVersions is able to match the version.

Signed-off-by: Chris. Webster <chris@webstech.net>
  • Loading branch information
webstech committed Jan 15, 2023
1 parent be2e196 commit 301687f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/semantic-release.js
Expand Up @@ -25,7 +25,7 @@ See https://github.com/semantic-release/semantic-release/blob/master/docs/suppor

execa("git", ["--version"])
.then(({ stdout }) => {
const gitVersion = findVersions(stdout)[0];
const gitVersion = findVersions(stdout, { loose: true })[0];
if (lt(gitVersion, MIN_GIT_VERSION)) {
console.error(`[semantic-release]: Git version ${MIN_GIT_VERSION} is required. Found ${gitVersion}.`);
process.exit(1);
Expand Down

1 comment on commit 301687f

@TRCREO
Copy link

@TRCREO TRCREO commented on 301687f Feb 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$ curl -I https://api.github.com/users/octocat/orgs

HTTP/2 200
Server: nginx
Date: Fri, 12 Oct 2012 23:33:14 GMT
Content-Type: application/json; charset=utf-8
ETag: "a00049ba79152d03380c34652f2cb612"
X-GitHub-Media-Type: github.v3
x-ratelimit-limit: 5000
x-ratelimit-remaining: 4987
x-ratelimit-reset: 1350085394
Content-Length: 5
Cache-Control: max-age=0, private, must-revalidate
X-Content-Type-Options: nosniff

Please sign in to comment.