!PokeBugLog saves Lua errors from any addon, PokeHuntLog messages, login session info and /bug notes into its saved variables, so bugs can be read from the file after a /reload. PokeHuntLog now logs tame detection, pet scans, stable slots, action bar slots and happiness drops there. tools/install.js copies both addons into the game.
33 lines
1.3 KiB
JavaScript
33 lines
1.3 KiB
JavaScript
// Copies the addons from this project into the game's AddOns folder, replacing only these addon folders.
|
|
// Usage: node tools/install.js [path to Interface\AddOns]
|
|
|
|
const fs = require("fs");
|
|
const path = require("path");
|
|
|
|
const ROOT = path.resolve(__dirname, "..");
|
|
const ADDONS = ["PokeHuntLog", "!PokeBugLog"];
|
|
const target = path.resolve(process.argv[2] || "E:\\Ravencraft\\twmoa_1181\\Interface\\AddOns");
|
|
|
|
if (!fs.existsSync(target)) {
|
|
console.error(`AddOns folder not found: ${target}`);
|
|
process.exit(1);
|
|
}
|
|
|
|
for (const name of ADDONS) {
|
|
const src = path.join(ROOT, name);
|
|
if (!fs.existsSync(path.join(src, `${name}.toc`))) {
|
|
console.error(`${name} is missing from the project (was it moved?). Restore it with: git checkout -- "${name}"`);
|
|
process.exit(1);
|
|
}
|
|
}
|
|
|
|
for (const name of ADDONS) {
|
|
const src = path.join(ROOT, name);
|
|
const dest = path.join(target, name);
|
|
fs.rmSync(dest, { recursive: true, force: true });
|
|
fs.cpSync(src, dest, { recursive: true });
|
|
const count = fs.readdirSync(dest, { recursive: true }).filter((f) => fs.statSync(path.join(dest, f)).isFile()).length;
|
|
const version = (fs.readFileSync(path.join(dest, `${name}.toc`), "utf8").match(/## Version:\s*(\S+)/) || [])[1];
|
|
console.log(`Installed ${name} ${version} (${count} files) -> ${dest}`);
|
|
}
|