mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-04 20:42:52 +00:00
refactor: add prefix to templates to avoid side effects
This commit is contained in:
@@ -79,14 +79,16 @@ NEEDED_FILES.forEach((file) => {
|
||||
// remove templates directory for destination files
|
||||
if (destinationFile.indexOf('templates') === 0) {
|
||||
destinationFile = destinationFile.split(sep).slice(1).join(sep);
|
||||
file = `templates/template-${destinationFile}`;
|
||||
}
|
||||
|
||||
const source = resolve(__dirname, '..', file);
|
||||
const destination = resolve(path, destinationFile);
|
||||
|
||||
// check if file exists or replace flag is set
|
||||
if (!existsSync(destination) || commander.replace) {
|
||||
copyFileSync(resolve(__dirname, '..', file), destination);
|
||||
console.info(`Added file "${destination}".`);
|
||||
copyFileSync(source, destination);
|
||||
console.info(`Copied file "${source}" to "${destination}".`);
|
||||
} else {
|
||||
console.info(`Not replacing "${destination}". Use "-r" or "--replace" to do so.`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user