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 99
1010var fs = require ( 'fs' ) ;
1111var path = require ( 'path' ) ;
12+ var spawnSync = require ( 'child_process' ) . spawnSync ;
1213
13- console . log ( 'Extracting scripts ...' ) ;
14+ console . log ( 'Graduating ...' ) ;
1415console . log ( ) ;
1516
1617var selfPath = path . join ( __dirname , '..' ) ;
@@ -65,11 +66,16 @@ Object.keys(hostPackage.scripts).forEach(function (key) {
6566} ) ;
6667delete hostPackage . scripts [ 'graduate' ] ;
6768
68- console . log ( 'Writing package.json... ' ) ;
69+ console . log ( 'Writing package.json' ) ;
6970fs . 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' } ) ;
7479console . log ( ) ;
80+
7581console . log ( 'Done!' ) ;
You can’t perform that action at this time.
0 commit comments