Handle whitespace in ForgeWrapper (#55)

Fix problem with generating version.json via ForgeWrapper when any path contains whitespace
This commit is contained in:
kaziu687 2020-11-23 00:42:13 +01:00 committed by GitHub
parent 3544dded05
commit 53403b158e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -375,9 +375,9 @@ class Handler {
getForgedWrapped () {
return new Promise(resolve => {
const libraryDirectory = path.resolve(this.options.overrides.libraryRoot || path.join(this.options.root, 'libraries'))
const launchArgs = `"${this.options.javaPath ? this.options.javaPath : 'java'}" -jar ${path.resolve(this.options.forgeWrapper.jar)}` +
` --installer=${this.options.forge} --instance=${this.options.root} ` +
`--saveTo=${path.join(libraryDirectory, 'io', 'github', 'zekerzhayard', 'ForgeWrapper', this.options.forgeWrapper.version)}`
const launchArgs = `"${this.options.javaPath ? this.options.javaPath : 'java'}" -jar "${path.resolve(this.options.forgeWrapper.jar)}"` +
` --installer="${this.options.forge}" --instance="${this.options.root}" ` +
`--saveTo="${path.join(libraryDirectory, 'io', 'github', 'zekerzhayard', 'ForgeWrapper', this.options.forgeWrapper.version)}"`
const fw = child.exec(launchArgs)
const forgeJson = path.join(this.options.root, 'forge', this.version.id, 'version.json')