Skip to content

Commit ce4af77

Browse files
committed
Fixed fabric download #4
1 parent 55f3398 commit ce4af77

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "simplelauncher",
3-
"version": "0.3.8",
3+
"version": "0.3.9",
44
"description": "Launcher for SimpleClient",
55
"main": "src/main.js",
66
"scripts": {

src/download/fabricdownloader.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const { join } = require("path")
2-
const { existsSync, statSync } = require("fs")
2+
const { existsSync, statSync, rmSync } = require("fs")
33
const { downloadFiles } = require("./downloader")
44
const { spawnSync } = require("child_process")
55
const { getDirectory, getMinecraftDir } = require("../util")
@@ -24,7 +24,8 @@ const downloadFabric = async (version, meta) => {
2424
}).signal != 0) return false
2525
log('Successfully installed Fabric Loader')
2626
}
27-
if (!existsSync(join(fabricDir, `${fabric}.jar`)) || statSync(join(fabricDir, `${fabric}.jar`)).size == 0) {
27+
if (statSync(join(fabricDir, `${fabric}.jar`)).size == 0) rmSync(join(fabricDir, `${fabric}.jar`))
28+
if (!existsSync(join(fabricDir, `${fabric}.jar`))) {
2829
return await downloadFiles([[meta.downloads.client.url, join(fabricDir, `${fabric}.jar`)]], undefined, log)
2930
} else return true
3031
}

0 commit comments

Comments
 (0)