48 lines
1.6 KiB
JavaScript
48 lines
1.6 KiB
JavaScript
/**
|
|
* {module_display_name} Module Installer
|
|
* Custom installation logic
|
|
*/
|
|
|
|
/**
|
|
* @param {Object} options - Installation options
|
|
* @param {string} options.projectRoot - Project root directory
|
|
* @param {Object} options.config - Module configuration from install-config.yaml
|
|
* @param {Array} options.installedIDEs - List of IDE codes being configured
|
|
* @param {Object} options.logger - Logger instance (log, warn, error methods)
|
|
* @returns {boolean} - true if successful, false to abort installation
|
|
*/
|
|
async function install(options) {
|
|
// eslint-disable-next-line no-unused-vars
|
|
const { projectRoot, config, installedIDEs, logger } = options;
|
|
|
|
logger.log('Installing {module_display_name}...');
|
|
|
|
try {
|
|
// TODO: Add your custom installation logic here
|
|
|
|
// Example: Create data directory
|
|
// const fs = require('fs');
|
|
// const dataPath = config.data_path;
|
|
// if (!fs.existsSync(dataPath)) {
|
|
// fs.mkdirSync(dataPath, { recursive: true });
|
|
// logger.log(`Created data directory: ${dataPath}`);
|
|
// }
|
|
|
|
// Example: Initialize configuration file
|
|
// const configPath = path.join(projectRoot, config.config_file);
|
|
// fs.writeFileSync(configPath, JSON.stringify({
|
|
// initialized: new Date().toISOString(),
|
|
// version: config.module_version
|
|
// }, null, 2));
|
|
|
|
logger.log('{module_display_name} installation complete!');
|
|
return true;
|
|
} catch (error) {
|
|
logger.error(`Installation failed: ${error.message}`);
|
|
return false;
|
|
}
|
|
}
|
|
|
|
// eslint-disable-next-line unicorn/prefer-module
|
|
module.exports = { install };
|