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

Commit

Permalink
shuffle.js: rm \n/\r's from gdPath that may occur
Browse files Browse the repository at this point in the history
  • Loading branch information
layercak3 committed Jun 15, 2022
1 parent 99d7327 commit 70b4610
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions shuffle.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ let iconRegex = /^.+?_(\d+?)_.+/
let forms = assets.forms
let sheetList = Object.keys(assets.sheets)
let glowName = sheetList.filter(x => x.startsWith('GJ_GameSheetGlow'))
let gdPath = 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 = 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 Expand Up @@ -135,4 +136,4 @@ console.log("Randomization complete!")

}

catch(e) { console.log(e); fs.writeFileSync('crash_log.txt', e.stack ? `Something went wrong! Send this error to Colon and he'll get around to fixing it at some point.\n\n${e.stack}` : e, 'utf8') }
catch(e) { console.log(e); fs.writeFileSync('crash_log.txt', e.stack ? `Something went wrong! Send this error to Colon and he'll get around to fixing it at some point.\n\n${e.stack}` : e, 'utf8') }

0 comments on commit 70b4610

Please sign in to comment.