Skip to content

Commit

Permalink
fix: remove BOM from manifest.json if present
Browse files Browse the repository at this point in the history
  • Loading branch information
ChecksumDev committed Jul 18, 2024
1 parent 2b3d652 commit 51e47f0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,16 @@ async function run(): Promise<void> {
: await findManifest(process.cwd())
if (manifestFile) {
core.info(`Found manifest.json at ${manifestFile}`)
const manifest = JSON.parse(await fs.readFile(manifestFile, 'utf8'))

let manifestStringData = await fs.readFile(manifestFile, 'utf-8')
if (manifestStringData.startsWith('\ufeff')) {
core.info('Removing BOM from manifest.json')
manifestStringData = manifestStringData.substring(1)
}

const manifest = JSON.parse(manifestStringData)
requestedVersion = manifest.gameVersion

core.info(`Inferred version: ${requestedVersion}`)
} else {
core.error('No manifest.json found and no version specified.')
Expand Down

0 comments on commit 51e47f0

Please sign in to comment.