2023-06-02 06:05:32 +00:00
|
|
|
const fs = require('fs');
|
|
|
|
const path = require('path');
|
|
|
|
|
|
|
|
const FILE_SUFFIX = '.user.js';
|
|
|
|
const DIST_DIR = 'dist';
|
|
|
|
|
|
|
|
const metadata = {
|
2022-12-31 10:15:23 +00:00
|
|
|
'extended-player-profile': `// ==UserScript==
|
|
|
|
// @name Extended player profile
|
2023-07-01 07:52:57 +00:00
|
|
|
// @version 1.1.4
|
2023-02-05 07:33:32 +00:00
|
|
|
// @description Adds additional info and actions on a player overview.
|
2022-12-31 10:15:23 +00:00
|
|
|
// @author Dawid Wysokiński - Kichiyaki - contact@dwysokinski.me
|
|
|
|
// @match https://*/game.php?*screen=info_player*
|
2023-01-29 08:43:27 +00:00
|
|
|
// @downloadURL ${process.env.PUBLIC_URL}/extended-player-profile.user.js
|
|
|
|
// @updateURL ${process.env.PUBLIC_URL}/extended-player-profile.user.js
|
2022-12-31 10:15:23 +00:00
|
|
|
// @icon https://www.google.com/s2/favicons?domain=plemiona.pl
|
|
|
|
// @grant none
|
|
|
|
// @run-at document-end
|
2023-02-04 11:40:38 +00:00
|
|
|
// ==/UserScript==`,
|
|
|
|
'extended-map-popup': `// ==UserScript==
|
|
|
|
// @name Extended map popup
|
2023-07-01 07:52:57 +00:00
|
|
|
// @version 1.0.3
|
2023-02-04 11:40:38 +00:00
|
|
|
// @description Extends the map popup with additional info.
|
|
|
|
// @author Dawid Wysokiński - Kichiyaki - contact@dwysokinski.me
|
|
|
|
// @match https://*/game.php?*screen=map*
|
|
|
|
// @downloadURL ${process.env.PUBLIC_URL}/extended-map-popup.user.js
|
|
|
|
// @updateURL ${process.env.PUBLIC_URL}/extended-map-popup.user.js
|
|
|
|
// @icon https://www.google.com/s2/favicons?domain=plemiona.pl
|
|
|
|
// @grant none
|
|
|
|
// @run-at document-end
|
2023-02-05 07:33:32 +00:00
|
|
|
// ==/UserScript==`,
|
|
|
|
'extended-village-profile': `// ==UserScript==
|
|
|
|
// @name Extended village profile
|
2023-07-01 07:52:57 +00:00
|
|
|
// @version 1.0.2
|
2023-02-05 07:33:32 +00:00
|
|
|
// @description Adds additional info and actions on a village overview.
|
|
|
|
// @author Dawid Wysokiński - Kichiyaki - contact@dwysokinski.me
|
|
|
|
// @match https://*/game.php?*screen=info_village*
|
|
|
|
// @downloadURL ${process.env.PUBLIC_URL}/extended-village-profile.user.js
|
|
|
|
// @updateURL ${process.env.PUBLIC_URL}/extended-village-profile.user.js
|
|
|
|
// @icon https://www.google.com/s2/favicons?domain=plemiona.pl
|
|
|
|
// @grant none
|
|
|
|
// @run-at document-end
|
2023-02-19 06:40:17 +00:00
|
|
|
// ==/UserScript==`,
|
|
|
|
'extended-tribe-profile': `// ==UserScript==
|
|
|
|
// @name Extended tribe profile
|
2023-07-01 07:52:57 +00:00
|
|
|
// @version 1.0.2
|
2023-02-19 06:40:17 +00:00
|
|
|
// @description Adds additional info and actions on a tribe overview.
|
|
|
|
// @author Dawid Wysokiński - Kichiyaki - contact@dwysokinski.me
|
|
|
|
// @match https://*/game.php?*screen=info_ally*
|
|
|
|
// @downloadURL ${process.env.PUBLIC_URL}/extended-tribe-profile.user.js
|
|
|
|
// @updateURL ${process.env.PUBLIC_URL}/extended-tribe-profile.user.js
|
|
|
|
// @icon https://www.google.com/s2/favicons?domain=plemiona.pl
|
|
|
|
// @grant none
|
|
|
|
// @run-at document-end
|
2023-01-29 08:43:27 +00:00
|
|
|
// ==/UserScript==`,
|
2022-12-31 10:15:23 +00:00
|
|
|
};
|
|
|
|
|
2023-06-02 06:05:32 +00:00
|
|
|
Object.entries(metadata).forEach(([name, m]) => {
|
|
|
|
const p = path.join('.', DIST_DIR, `${name}${FILE_SUFFIX}`);
|
|
|
|
const data = fs.readFileSync(p);
|
|
|
|
const fd = fs.openSync(p, 'w+');
|
|
|
|
const insert = Buffer.from(`${m}\n`);
|
|
|
|
fs.writeSync(fd, insert, 0, insert.length, 0);
|
|
|
|
fs.writeSync(fd, data, 0, data.length, insert.length);
|
|
|
|
fs.closeSync(fd);
|
|
|
|
});
|