mirror of
https://github.com/actions/setup-go.git
synced 2025-04-10 15:00:13 +08:00
Merge 6ecdea2b649cf54f04d23e9235d7a28e626bb247 into 0aaccfd150d50ccaeb58ebd88d36e91967a5f35b
This commit is contained in:
commit
e778867169
4
dist/setup/index.js
vendored
4
dist/setup/index.js
vendored
@ -93486,6 +93486,10 @@ function parseGoVersionFile(versionFilePath) {
|
|||||||
const match = contents.match(/^go (\d+(\.\d+)*)/m);
|
const match = contents.match(/^go (\d+(\.\d+)*)/m);
|
||||||
return match ? match[1] : '';
|
return match ? match[1] : '';
|
||||||
}
|
}
|
||||||
|
else if (path.basename(versionFilePath) === '.tool-versions') {
|
||||||
|
const match = contents.match(/^golang\s+(\d+(\.\d+)*)/m);
|
||||||
|
return match ? match[1] : '';
|
||||||
|
}
|
||||||
return contents.trim();
|
return contents.trim();
|
||||||
}
|
}
|
||||||
exports.parseGoVersionFile = parseGoVersionFile;
|
exports.parseGoVersionFile = parseGoVersionFile;
|
||||||
|
@ -466,6 +466,9 @@ export function parseGoVersionFile(versionFilePath: string): string {
|
|||||||
) {
|
) {
|
||||||
const match = contents.match(/^go (\d+(\.\d+)*)/m);
|
const match = contents.match(/^go (\d+(\.\d+)*)/m);
|
||||||
return match ? match[1] : '';
|
return match ? match[1] : '';
|
||||||
|
} else if (path.basename(versionFilePath) === '.tool-versions') {
|
||||||
|
const match = contents.match(/^golang\s+(\d+(\.\d+)*)/m);
|
||||||
|
return match ? match[1] : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
return contents.trim();
|
return contents.trim();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user