Skip to content

Commit

Permalink
Merge 92809e0 into d8d597f
Browse files Browse the repository at this point in the history
  • Loading branch information
MarsiBarsi committed Jan 15, 2020
2 parents d8d597f + 92809e0 commit 8600bfc
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 11 deletions.
41 changes: 30 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"start": "ng serve",
"start:ssr": "npm run build:demo:ssr && npm run serve:ssr",
"build": "ng build",
"postbuild": "node scripts/postbuild.js",
"build:schematics": "tsc -p tsconfig.schematics.json",
"build:demo:client": "ng run demo:build",
"build:demo:server": "ng run demo:server",
Expand Down
22 changes: 22 additions & 0 deletions scripts/postbuild.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const fs = require('fs');

const DIST_LIB_PATH = 'dist/ng-polymorpheus/';
const README_PATH = 'README.md';

const PATH_TO = DIST_LIB_PATH + README_PATH;

copyReadmeIntoDistFolder();

function copyReadmeIntoDistFolder() {
if (!fs.existsSync(README_PATH)) {
throw new Error('README.md does not exist');
} else {
const fileBody = fs.readFileSync(README_PATH).toString();
const withoutLogo = fileBody.replace(
'![Polymorpheus](projects/demo/assets/logo.svg)',
'',
);

fs.writeFileSync(PATH_TO, withoutLogo);
}
}

0 comments on commit 8600bfc

Please sign in to comment.