fix: read specified global.json file (#31)

This commit is contained in:
Joanna May 2023-04-08 13:09:09 -05:00 committed by GitHub
parent c61b59a7c8
commit 5880cd9daf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 3 deletions

4
dist/index.js generated vendored
View File

@ -78,8 +78,10 @@ function run(platform) {
if (!hasGlobalJsonFile) {
throw new Error(`🚨 Cannot find global.json file to infer the Godot version from.`);
}
const globalJsonFileContents = fs.readFileSync('global.json', 'utf8');
const globalJsonFileContents = fs.readFileSync(globalJsonPath, 'utf8');
core.info(`🖨 global.json contents: ${globalJsonFileContents}`);
const globalJson = (_b = JSON.parse(globalJsonFileContents)) !== null && _b !== void 0 ? _b : {};
core.info(`🖨 global.json parsed contents: ${JSON.stringify(globalJsonFileContents, null, 2)}`);
version = (_c = globalJson['msbuild-sdks']['Godot.NET.Sdk']) !== null && _c !== void 0 ? _c : '';
}
// Compute derived information from Godot version.

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@ -46,8 +46,16 @@ async function run(platform: Platform): Promise<void> {
`🚨 Cannot find global.json file to infer the Godot version from.`
)
}
const globalJsonFileContents = fs.readFileSync('global.json', 'utf8')
const globalJsonFileContents = fs.readFileSync(globalJsonPath, 'utf8')
core.info(`🖨 global.json contents: ${globalJsonFileContents}`)
const globalJson = JSON.parse(globalJsonFileContents) ?? {}
core.info(
`🖨 global.json parsed contents: ${JSON.stringify(
globalJsonFileContents,
null,
2
)}`
)
version = globalJson['msbuild-sdks']['Godot.NET.Sdk'] ?? ''
}