fix: download to correct folder if custom is specified (#75)

download the .json and the jar to the custom folder if it is specified

works with and without custom being set
This commit is contained in:
Just a Badly Drawn TABS Dude 2021-07-08 19:15:25 +02:00 committed by GitHub
parent 5c29c67ee5
commit 9efda4b9f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -133,7 +133,7 @@ class Handler {
} }
async getJar () { async getJar () {
await this.downloadAsync(this.version.downloads.client.url, this.options.directory, `${this.options.version.number}.jar`, true, 'version-jar') await this.downloadAsync(this.version.downloads.client.url, this.options.directory, `${this.options.version.custom ? this.options.version.custom : this.options.version.number}.jar`, true, 'version-jar')
fs.writeFileSync(path.join(this.options.directory, `${this.options.version.number}.json`), JSON.stringify(this.version, null, 4)) fs.writeFileSync(path.join(this.options.directory, `${this.options.version.number}.json`), JSON.stringify(this.version, null, 4))

View file

@ -52,7 +52,7 @@ class MCLCore extends EventEmitter {
await this.handler.runInstaller(this.options.installer) await this.handler.runInstaller(this.options.installer)
} }
const directory = this.options.overrides.directory || path.join(this.options.root, 'versions', this.options.version.number) const directory = this.options.overrides.directory || path.join(this.options.root, 'versions', this.options.version.custom ? this.options.version.custom : this.options.version.number)
this.options.directory = directory this.options.directory = directory
const versionFile = await this.handler.getVersion() const versionFile = await this.handler.getVersion()