Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

Commit

Permalink
Merge pull request #20 from AtticFinder65536/fix-gdpath-read
Browse files Browse the repository at this point in the history
shuffle.js: remove newlines and carriage returns from gdPath before using it
  • Loading branch information
GDColon committed Jun 15, 2022
2 parents 93273c3 + b81a785 commit 49fea56
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion shuffle.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ let iconRegex = /^.+?_(\d+?)_.+/
let forms = assets.forms
let sheetList = Object.keys(assets.sheets)
let glowName = sheetList.filter(x => x.startsWith('GJ_GameSheetGlow'))
let gdPath = process.argv[2] ?? fs.readFileSync('directory.txt', 'utf8')

// newlines/CRs are usually present in text files, strip them out so they aren't part of the pathname
let gdPath = process.argv[2] ?? fs.readFileSync('directory.txt', 'utf8').replace(/[\n\r]/g, '')

if (!fs.existsSync(gdPath)) throw "Couldn't find your GD directory! Make sure to enter the correct file path in directory.txt"
let glowPlist = fs.readFileSync(`${gdPath}/${glowName[0]}.plist`, 'utf8')
let sheetNames = sheetList.filter(x => !glowName.includes(x))
Expand Down

0 comments on commit 49fea56

Please sign in to comment.