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

shuffle.js: support reading dir from argv[2] #21

Merged
merged 1 commit into from
Jun 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
shuffle.js: support reading dir from argv[2]
  • Loading branch information
layercak3 committed Jun 15, 2022
commit ab801987b64cc494b74ce7fcdb619f289a386388
7 changes: 6 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,9 @@ HOW TO USE:
===

If the program closes as soon as you open it, that means it crashed.
A file called crash_log.txt will be created - send it to Colon and he'll hopefully get around to fixing it.
A file called crash_log.txt will be created - send it to Colon and he'll hopefully get around to fixing it.

===

Mac/Linux/non-Windows users, or if the game is installed in a nonstandard location:
Replace the directory in directory.txt with whereever the game's Resources folder is located on your system, or simply pass it as a command-line argument.
4 changes: 2 additions & 2 deletions shuffle.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ 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')
let gdPath = process.argv[2] ?? fs.readFileSync('directory.txt', 'utf8')
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 +135,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') }