mirror of
https://github.com/actions/setup-go.git
synced 2025-04-21 08:28:46 +00:00
Merge 6ecdea2b64
into dca8468d37
This commit is contained in:
commit
547af83df9
2 changed files with 7 additions and 0 deletions
4
dist/setup/index.js
vendored
4
dist/setup/index.js
vendored
|
@ -93568,6 +93568,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;
|
||||
|
|
|
@ -462,6 +462,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…
Add table
Reference in a new issue