-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstaller.conf.js
More file actions
23 lines (19 loc) · 1.06 KB
/
installer.conf.js
File metadata and controls
23 lines (19 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const { readFileSync, } = require('fs');
const { configureModules, createLocalFolders, createLocalFiles } = require('./src/installer');
const path = require('path');
const configuration_data = readFileSync(path.resolve('./source.conf.js'), 'utf8');
async function configurePlugin(module_name, module) {
/** Checks if plugin is configured */
if (module === "your_dependency_name") {
/** Configures dependencies */
const config_path = path.join(module_name, "Example Config.js"); // Path to the config file
const config_data = readFileSync(config_path, 'utf8'); // Reads the config file
/** Configures dependencies */
if (configuration_data !== config_data) {
configureModules(config_path, configuration_data, module); // Configures the dependencies
createLocalFolders(path.resolve("./example/")) // Creates the example folder
createLocalFiles(path.resolve("./example/Example Config.js"), configuration_data); // Creates the example config file
}
}
}
module.exports = { configurePlugin };