Skip to content

Commit

Permalink
fix: read specified global.json file (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
jolexxa authored Apr 8, 2023
1 parent c61b59a commit 5880cd9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
4 changes: 3 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'] ?? ''
}

Expand Down

0 comments on commit 5880cd9

Please sign in to comment.