Update manifest
This commit is contained in:
parent
834fcb95be
commit
8399b8637b
19
manifest
19
manifest
|
@ -126,13 +126,10 @@ module.exports = {
|
||||||
return data
|
return data
|
||||||
},
|
},
|
||||||
|
|
||||||
after_install: async ({ manifest, pack_dir, tmp_dir, spinner }) => {
|
after_install: async ({ manifest, pack_dir, tmp_dir }) => {
|
||||||
if (global._.forgeVersion) {
|
console.log(manifest)
|
||||||
if (spinner) {
|
|
||||||
spinner.color = "yellow"
|
|
||||||
spinner.text = `Installing Forge version and libraries...`
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (global._.forgeVersion) {
|
||||||
await new Promise((resolve, reject) => {
|
await new Promise((resolve, reject) => {
|
||||||
const process = child_process.execFile("java", ["-jar", `${pack_dir}/tmp/forge-installer.jar`, "-installClient"], {
|
const process = child_process.execFile("java", ["-jar", `${pack_dir}/tmp/forge-installer.jar`, "-installClient"], {
|
||||||
cwd: pack_dir,
|
cwd: pack_dir,
|
||||||
|
@ -142,15 +139,11 @@ module.exports = {
|
||||||
process.on("exit", resolve)
|
process.on("exit", resolve)
|
||||||
process.on("error", reject)
|
process.on("error", reject)
|
||||||
})
|
})
|
||||||
|
|
||||||
if (spinner) {
|
|
||||||
spinner.succeed()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const minecraftGameFolder = resolveMcPath()
|
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")
|
const profilesFilePath = path.resolve(pack_dir, "launcher_profiles.json")
|
||||||
|
|
||||||
let profiles_json = {
|
let profiles_json = {
|
||||||
|
@ -171,7 +164,7 @@ module.exports = {
|
||||||
profiles: {},
|
profiles: {},
|
||||||
}
|
}
|
||||||
|
|
||||||
let legacy_profiles_json = fs.readFileSync(legacyLauncherProfilesPath, "utf8")
|
let legacy_profiles_json = JSON.parse(fs.readFileSync(legacy_ProfilesFilePath))
|
||||||
|
|
||||||
const profileData = {
|
const profileData = {
|
||||||
name: manifest.pack_name,
|
name: manifest.pack_name,
|
||||||
|
@ -189,7 +182,7 @@ module.exports = {
|
||||||
profiles_json.profiles[manifest.id] = profileData
|
profiles_json.profiles[manifest.id] = profileData
|
||||||
|
|
||||||
fs.writeFileSync(profilesFilePath, JSON.stringify(profiles_json, null, 2))
|
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") {
|
if (os.type() === "Windows_NT") {
|
||||||
const runwinBat = path.resolve(pack_dir, "runwin.bat")
|
const runwinBat = path.resolve(pack_dir, "runwin.bat")
|
||||||
|
|
Loading…
Reference in New Issue