File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 9
9
10
10
var fs = require ( 'fs' ) ;
11
11
var path = require ( 'path' ) ;
12
+ var spawnSync = require ( 'child_process' ) . spawnSync ;
12
13
13
- console . log ( 'Extracting scripts ...' ) ;
14
+ console . log ( 'Graduating ...' ) ;
14
15
console . log ( ) ;
15
16
16
17
var selfPath = path . join ( __dirname , '..' ) ;
@@ -65,11 +66,16 @@ Object.keys(hostPackage.scripts).forEach(function (key) {
65
66
} ) ;
66
67
delete hostPackage . scripts [ 'graduate' ] ;
67
68
68
- console . log ( 'Writing package.json... ' ) ;
69
+ console . log ( 'Writing package.json' ) ;
69
70
fs . writeFileSync (
70
71
path . join ( hostPath , 'package.json' ) ,
71
72
JSON . stringify ( hostPackage , null , 2 )
72
73
) ;
74
+ console . log ( ) ;
73
75
76
+ console . log ( 'Running npm install...' ) ;
77
+ spawnSync ( 'rm' , [ '-rf' , selfPath ] ) ;
78
+ spawnSync ( 'npm' , [ 'install' ] , { stdio : 'inherit' } ) ;
74
79
console . log ( ) ;
80
+
75
81
console . log ( 'Done!' ) ;
You can’t perform that action at this time.
0 commit comments