Skip to content

Commit 89a00ae

Browse files
committed
feat(package): add deploy script and postdeploy hook
1 parent 44817fd commit 89a00ae

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

copy_www_to_docs.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env node
2+
3+
// Copy Browser Code To Docs for Github Pages
4+
// v1.0
5+
// Automatically copies the www/ contents to /docs so that
6+
// the repository can automatically be hosted with Github pages
7+
8+
var shell = require('child_process').execSync;
9+
var fs = require('fs');
10+
var path = require('path');
11+
12+
const src= 'www';
13+
const dist= 'docs';
14+
15+
shell(`mkdir -p ${dist}`);
16+
shell(`cp -r ${src}/* ${dist}`);

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
"ionic:build": "ionic-app-scripts build",
1010
"ionic:serve": "ionic-app-scripts serve",
1111
"add-contributor": "all-contributors add",
12-
"generate-contributors": "all-contributors generate"
12+
"generate-contributors": "all-contributors generate",
13+
"deploy": "npm run build --prod",
14+
"postdeploy": "node copy_www_to_docs.js"
1315
},
1416
"dependencies": {
1517
"@angular/common": "5.0.0",

0 commit comments

Comments
 (0)