Update manifest
This commit is contained in:
parent
c549b34d6d
commit
834fcb95be
8
manifest
8
manifest
|
@ -150,7 +150,7 @@ module.exports = {
|
||||||
|
|
||||||
const minecraftGameFolder = resolveMcPath()
|
const minecraftGameFolder = resolveMcPath()
|
||||||
|
|
||||||
const legacyLauncherProfiles = path.resolve(minecraftGameFolder, "launcher_profiles.json")
|
const legacyLauncherProfilesPath = 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,6 +171,8 @@ module.exports = {
|
||||||
profiles: {},
|
profiles: {},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let legacy_profiles_json = fs.readFileSync(legacyLauncherProfilesPath, "utf8")
|
||||||
|
|
||||||
const profileData = {
|
const profileData = {
|
||||||
name: manifest.pack_name,
|
name: manifest.pack_name,
|
||||||
gameDir: pack_dir,
|
gameDir: pack_dir,
|
||||||
|
@ -182,14 +184,16 @@ module.exports = {
|
||||||
icon: await readImageToB64(`${pack_dir}/icon/mc.png`),
|
icon: await readImageToB64(`${pack_dir}/icon/mc.png`),
|
||||||
}
|
}
|
||||||
|
|
||||||
legacyLauncherProfiles.profiles[manifest.id] = profileData
|
legacy_profiles_json.profiles[manifest.id] = profileData
|
||||||
|
|
||||||
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)
|
||||||
|
|
||||||
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")
|
||||||
|
|
||||||
fs.writeFileSync(runwinBat, `
|
fs.writeFileSync(runwinBat, `
|
||||||
@echo off
|
@echo off
|
||||||
cd "%ProgramFiles(x86)%/Minecraft Launcher"
|
cd "%ProgramFiles(x86)%/Minecraft Launcher"
|
||||||
|
|
Loading…
Reference in New Issue