diff --git a/manifest b/manifest index 1d31764..84c9725 100644 --- a/manifest +++ b/manifest @@ -126,13 +126,10 @@ module.exports = { return data }, - after_install: async ({ manifest, pack_dir, tmp_dir, spinner }) => { - if (global._.forgeVersion) { - if (spinner) { - spinner.color = "yellow" - spinner.text = `Installing Forge version and libraries...` - } + after_install: async ({ manifest, pack_dir, tmp_dir }) => { + console.log(manifest) + if (global._.forgeVersion) { await new Promise((resolve, reject) => { const process = child_process.execFile("java", ["-jar", `${pack_dir}/tmp/forge-installer.jar`, "-installClient"], { cwd: pack_dir, @@ -142,15 +139,11 @@ module.exports = { process.on("exit", resolve) process.on("error", reject) }) - - if (spinner) { - spinner.succeed() - } } const minecraftGameFolder = resolveMcPath() - const legacyLauncherProfilesPath = path.resolve(minecraftGameFolder, "launcher_profiles.json") + const legacy_ProfilesFilePath = path.resolve(minecraftGameFolder, "launcher_profiles.json") const profilesFilePath = path.resolve(pack_dir, "launcher_profiles.json") let profiles_json = { @@ -171,7 +164,7 @@ module.exports = { profiles: {}, } - let legacy_profiles_json = fs.readFileSync(legacyLauncherProfilesPath, "utf8") + let legacy_profiles_json = JSON.parse(fs.readFileSync(legacy_ProfilesFilePath)) const profileData = { name: manifest.pack_name, @@ -189,7 +182,7 @@ module.exports = { profiles_json.profiles[manifest.id] = profileData fs.writeFileSync(profilesFilePath, JSON.stringify(profiles_json, null, 2)) - fs.writeFileSync(legacyLauncherProfilesPath, legacy_profiles_json) + fs.writeFileSync(legacy_ProfilesFilePath, JSON.stringify(legacy_profiles_json, null, 2)) if (os.type() === "Windows_NT") { const runwinBat = path.resolve(pack_dir, "runwin.bat")