Skip to content

Commit

Permalink
fix(angular): copy schema only once in postbuild script (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-bompart authored Mar 17, 2021
1 parent a1cbb0a commit dceea50
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions packages/angular/scripts/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,10 @@ const {join} = require('path');
const {copyFile, copy, ensureDir, pathExists} = require('fs-extra');
const collection = require('../src/collection.json');

async function copySchemas() {
async function copySchema() {
await ensureDir(destDir);
const schematics = Object.values(collection.schematics);
return Promise.all(
schematics.map((sch) =>
copyFile(join(srcDir, sch.schema), join(destDir, sch.schema))
)
);
const schematics = collection.schematics['ng-add'].schema;
await copyFile(join(srcDir, schematics), join(destDir, schematics));
}

async function copyFiles(srcDir, destDir) {
Expand All @@ -36,7 +32,7 @@ const srcDir = './src';
const destDir = './dist';

Promise.all([
copySchemas(srcDir, destDir),
copySchema(srcDir, destDir),
copyFiles(srcDir, destDir),
copyCollection(srcDir, destDir),
])
Expand Down

0 comments on commit dceea50

Please sign in to comment.