diff --git a/tools/autowiki/autowiki.js b/tools/autowiki/autowiki.js index 0d2a4c1c4595..3e5ecd31b5b7 100644 --- a/tools/autowiki/autowiki.js +++ b/tools/autowiki/autowiki.js @@ -1,49 +1,49 @@ -const fs = require("fs").promises; -const MWBot = require("mwbot"); +const fs = require('fs').promises; +const MWBot = require('mwbot'); const { USERNAME, PASSWORD } = process.env; if (!USERNAME) { - console.error("USERNAME was not set."); + console.error('USERNAME was not set.'); process.exit(1); } if (!PASSWORD) { - console.error("PASSWORD was not set."); + console.error('PASSWORD was not set.'); process.exit(1); } const PAGE_EDIT_FILENAME = process.argv[2]; if (!PAGE_EDIT_FILENAME) { - console.error("No filename specified to edit pages"); + console.error('No filename specified to edit pages'); process.exit(1); } const FILE_EDIT_FILENAME = process.argv[3]; if (!FILE_EDIT_FILENAME) { - console.error("No filename specified to edit files"); + console.error('No filename specified to edit files'); process.exit(1); } async function main() { console.log(`Reading from ${PAGE_EDIT_FILENAME}`); - const editFile = await ( - await fs.readFile(PAGE_EDIT_FILENAME, "utf8") - ).split("\n"); + const editFile = await (await fs.readFile(PAGE_EDIT_FILENAME, 'utf8')).split( + '\n', + ); console.log(`Logging in as ${USERNAME}`); const bot = new MWBot(); await bot.loginGetEditToken({ - apiUrl: "https://wiki.tgstation13.org/api.php", + apiUrl: 'https://wiki.pmeta.space/api.php', username: USERNAME, password: PASSWORD, }); - console.log("Logged in"); + console.log('Logged in'); // This is not Promise.all as to not flood with a bunch of traffic at once for (const editLine of editFile) { @@ -53,7 +53,7 @@ async function main() { let { title, text } = JSON.parse(editLine); text = - "This page is automated by Autowiki. Do NOT edit it manually." + + 'This page is automated by Autowiki. Do NOT edit it manually.' + text; console.log(`Editing ${title}...`); @@ -73,7 +73,7 @@ async function main() { `Autowiki upload @ ${new Date().toISOString()}`, ) .catch((error) => { - if (error.code === "fileexists-no-change") { + if (error.code === 'fileexists-no-change') { console.log(`${assetName} is an exact duplicate`); } else { return Promise.reject(error);