-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathgenerate_plugin_cfg.js
More file actions
26 lines (19 loc) · 799 Bytes
/
generate_plugin_cfg.js
File metadata and controls
26 lines (19 loc) · 799 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
const fs = require('fs');
const ADDON_PATH = 'addons/hexagon_tilemaplayer';
const packageJson = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
const content = `[plugin]
name="${packageJson.displayName}"
description="${packageJson.description}"
author="${packageJson.author}"
version="${packageJson.version}"
script="${packageJson.main}"
`;
const filePath = `${ADDON_PATH}/plugin.cfg`;
fs.writeFileSync(filePath, content);
console.log(`Plugin configuration file ${filePath} updated (version ${packageJson.version})`);
// Copy all .md files from root to addon directory
const mdFiles = fs.readdirSync('.').filter(file => file.endsWith('.md'));
mdFiles.forEach(file => {
fs.copyFileSync(file, `${ADDON_PATH}/${file}`);
console.log(`Copied ${file} to ${ADDON_PATH}/${file}`);
});