forked from Isma/mods
1
0
Fork 0

Update manifest

This commit is contained in:
srgooglo 2023-11-02 23:35:42 +01:00
parent 834fcb95be
commit 8399b8637b
1 changed files with 6 additions and 13 deletions

View File

@ -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")