refactor(modules): moved modules to app to control everything based on there active setting
This commit is contained in:
@@ -11,6 +11,13 @@ const dest_settings = path.resolve(
|
||||
"dist/src/internal/system/controller/settings/settings.json",
|
||||
);
|
||||
|
||||
const src_modules = path.resolve(
|
||||
"app/src/internal/system/controller/modules/modules.json",
|
||||
);
|
||||
const dest_modules = path.resolve(
|
||||
"dist/src/internal/system/controller/modules/modules.json",
|
||||
);
|
||||
|
||||
// Delete old views if they exist
|
||||
if (fs.existsSync(dest_views)) {
|
||||
fs.rmSync(dest_views, { recursive: true, force: true });
|
||||
@@ -21,14 +28,24 @@ if (fs.existsSync(dest_settings)) {
|
||||
fs.rmSync(dest_settings, { force: true }); // for single files we dont need the recursive
|
||||
}
|
||||
|
||||
if (fs.existsSync(dest_modules)) {
|
||||
fs.rmSync(dest_modules, { force: true }); // for single files we dont need the recursive
|
||||
}
|
||||
|
||||
// Ensure the destination directory exists for settings.json
|
||||
const dest_settings_dir = path.dirname(dest_settings);
|
||||
if (!fs.existsSync(dest_settings_dir)) {
|
||||
fs.mkdirSync(dest_settings_dir, { recursive: true });
|
||||
}
|
||||
|
||||
const dest_modules_dir = path.dirname(dest_modules);
|
||||
if (!fs.existsSync(dest_modules_dir)) {
|
||||
fs.mkdirSync(dest_modules_dir, { recursive: true });
|
||||
}
|
||||
|
||||
// Copy files
|
||||
fs.copyFileSync(src_settings, dest_settings);
|
||||
fs.copyFileSync(src_modules, dest_modules);
|
||||
fs.cpSync(src_views, dest_views, { recursive: true });
|
||||
|
||||
console.log(`All files copied`);
|
||||
|
||||
Reference in New Issue
Block a user