mirror of
https://git.bits.team/Bits/mod-manager.git
synced 2024-11-14 10:28:21 -05:00
Refactor method name
This commit is contained in:
parent
0071d32eb7
commit
b69b6bd725
@ -73,7 +73,7 @@ export default class Mods {
|
|||||||
mods.push(mod);
|
mods.push(mod);
|
||||||
|
|
||||||
// Write list back to file
|
// Write list back to file
|
||||||
this.writeFile(mods);
|
this.writeToModFile(mods);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static getTrackedMods(): Array<Mod> {
|
public static getTrackedMods(): Array<Mod> {
|
||||||
@ -81,7 +81,7 @@ export default class Mods {
|
|||||||
return JSON.parse(file);
|
return JSON.parse(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static writeFile(mods: Array<Mod>): void {
|
public static writeToModFile(mods: Array<Mod>): void {
|
||||||
writeFileSync(ModManager.FilePaths.MOD_FILE_PATH, JSON.stringify(mods, null, 4));
|
writeFileSync(ModManager.FilePaths.MOD_FILE_PATH, JSON.stringify(mods, null, 4));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,7 +111,7 @@ export default class Mods {
|
|||||||
// Remove mod from list and uninstall it
|
// Remove mod from list and uninstall it
|
||||||
unlinkSync(path.join(ModManager.FilePaths.MODS_FOLDER_PATH, mod.fileName));
|
unlinkSync(path.join(ModManager.FilePaths.MODS_FOLDER_PATH, mod.fileName));
|
||||||
mods = mods.filter(item => !Mods.areModsEqual(item, mod));
|
mods = mods.filter(item => !Mods.areModsEqual(item, mod));
|
||||||
this.writeFile(mods);
|
this.writeToModFile(mods);
|
||||||
}
|
}
|
||||||
|
|
||||||
static areModsEqual(mod1: Mod, mod2: Mod): boolean {
|
static areModsEqual(mod1: Mod, mod2: Mod): boolean {
|
||||||
@ -129,7 +129,7 @@ export default class Mods {
|
|||||||
// Toggle essential status, and write back to file
|
// Toggle essential status, and write back to file
|
||||||
modToMark.essential = !modToMark.essential;
|
modToMark.essential = !modToMark.essential;
|
||||||
mods.push(modToMark)
|
mods.push(modToMark)
|
||||||
this.writeFile(mods);
|
this.writeToModFile(mods);
|
||||||
|
|
||||||
if (modToMark.essential) {
|
if (modToMark.essential) {
|
||||||
PrintUtils.success(`Marked ${modToMark.name} as essential`)
|
PrintUtils.success(`Marked ${modToMark.name} as essential`)
|
||||||
|
Loading…
Reference in New Issue
Block a user