
committed by
Matias Niemelä

parent
ca129ba549
commit
c30eff898a
@ -54,6 +54,12 @@ BOILERPLATE_PATHS.i18n = [
|
||||
'package.json'
|
||||
];
|
||||
|
||||
BOILERPLATE_PATHS.universal = [
|
||||
...cliRelativePath,
|
||||
'.angular-cli.json',
|
||||
'package.json'
|
||||
];
|
||||
|
||||
const EXAMPLE_CONFIG_FILENAME = 'example-config.json';
|
||||
|
||||
class ExampleBoilerPlate {
|
||||
@ -110,6 +116,10 @@ class ExampleBoilerPlate {
|
||||
|
||||
copyFile(sourceFolder, destinationFolder, filePath) {
|
||||
const sourcePath = path.resolve(sourceFolder, filePath);
|
||||
|
||||
// normalize path if needed
|
||||
filePath = this.normalizePath(filePath);
|
||||
|
||||
const destinationPath = path.resolve(destinationFolder, filePath);
|
||||
fs.copySync(sourcePath, destinationPath, { overwrite: true });
|
||||
fs.chmodSync(destinationPath, 444);
|
||||
@ -118,6 +128,11 @@ class ExampleBoilerPlate {
|
||||
loadJsonFile(filePath) {
|
||||
return fs.readJsonSync(filePath, {throws: false}) || {};
|
||||
}
|
||||
|
||||
normalizePath(filePath) {
|
||||
// transform for example ../cli/src/tsconfig.app.json to src/tsconfig.app.json
|
||||
return filePath.replace(/\.{2}\/\w+\//, '');
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = new ExampleBoilerPlate();
|
||||
|
Reference in New Issue
Block a user