mirror of
https://github.com/actions/setup-go.git
synced 2023-09-23 05:03:39 +00:00
Merge 6ecdea2b64
into 93397bea11
This commit is contained in:
commit
7b7b94dffb
4
dist/setup/index.js
vendored
4
dist/setup/index.js
vendored
@ -61683,6 +61683,10 @@ function parseGoVersionFile(versionFilePath) {
|
||||
const match = contents.match(/^go (\d+(\.\d+)*)/m);
|
||||
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();
|
||||
}
|
||||
exports.parseGoVersionFile = parseGoVersionFile;
|
||||
|
@ -415,6 +415,9 @@ export function parseGoVersionFile(versionFilePath: string): string {
|
||||
) {
|
||||
const match = contents.match(/^go (\d+(\.\d+)*)/m);
|
||||
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();
|
||||
|
Loading…
Reference in New Issue
Block a user