Skip to content

Commit afa910b

Browse files
committed
npm install on graduation
1 parent 85a8000 commit afa910b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

scripts/graduate.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99

1010
var fs = require('fs');
1111
var path = require('path');
12+
var spawnSync = require('child_process').spawnSync;
1213

13-
console.log('Extracting scripts...');
14+
console.log('Graduating...');
1415
console.log();
1516

1617
var selfPath = path.join(__dirname, '..');
@@ -65,11 +66,16 @@ Object.keys(hostPackage.scripts).forEach(function (key) {
6566
});
6667
delete hostPackage.scripts['graduate'];
6768

68-
console.log('Writing package.json...');
69+
console.log('Writing package.json');
6970
fs.writeFileSync(
7071
path.join(hostPath, 'package.json'),
7172
JSON.stringify(hostPackage, null, 2)
7273
);
74+
console.log();
7375

76+
console.log('Running npm install...');
77+
spawnSync('rm', ['-rf', selfPath]);
78+
spawnSync('npm', ['install'], {stdio: 'inherit'});
7479
console.log();
80+
7581
console.log('Done!');

0 commit comments

Comments
 (0)