Files
notforever-ship-it 3d0f103891 Macro Maker 1.0.0
Build macros for any class on the 1.12 client (Turtle WoW, OctoWoW) without typing code: pick what the button should do, click spells from your own spellbook, press Create. Includes the MMK helper functions smart macros call, a Help window and a minimap button.
2026-09-24 14:18:27 +01:00

40 lines
1.6 KiB
JavaScript

// Copies the addon from this project into the game's AddOns folder, replacing only its own folder.
// The addon files live at the repo root (launchers expect the .toc there), so only the game's files
// are copied: the .toc and the Lua files. Development files stay behind.
// Usage: node tools/install.js [path to Interface\AddOns]
const fs = require("fs");
const path = require("path");
const ROOT = path.resolve(__dirname, "..");
const ADDON = "MacroMaker";
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);
}
if (!fs.existsSync(path.join(ROOT, `${ADDON}.toc`))) {
console.error(`${ADDON}.toc is missing from the project. Restore it with: git checkout -- .`);
process.exit(1);
}
const entries = fs.readdirSync(ROOT, { withFileTypes: true }).filter((e) => {
if (e.isDirectory()) return false;
return e.name.endsWith(".lua") || e.name === `${ADDON}.toc`;
});
const dest = path.join(target, ADDON);
fs.rmSync(dest, { recursive: true, force: true });
fs.mkdirSync(dest, { recursive: true });
let count = 0;
for (const entry of entries) {
const from = path.join(ROOT, entry.name);
const to = path.join(dest, entry.name);
fs.cpSync(from, to, { recursive: true });
count += entry.isDirectory() ? fs.readdirSync(from).length : 1;
}
const version = (fs.readFileSync(path.join(dest, `${ADDON}.toc`), "utf8").match(/## Version:\s*(\S+)/) || [])[1];
console.log(`Installed ${ADDON} ${version} (${count} files) -> ${dest}`);