@@ -2,10 +2,8 @@ const path = require('path');
22const spawn = require ( 'cross-spawn' ) ;
33const chalk = require ( 'chalk' ) ;
44const extend = require ( 'extend' ) ;
5- const pathExists = require ( 'path-exists' ) ;
65const prompt = require ( 'prompt' ) ;
7- const fs = require ( 'fs' ) ;
8- const copySync = require ( 'fs-extra' ) . copySync ;
6+ const fs = require ( 'fs-extra' ) ;
97const Table = require ( 'cli-table' ) ;
108const Promise = require ( 'bluebird' ) ;
119const pkgOwn = require ( path . join ( __dirname , '../package.json' ) ) ;
@@ -72,9 +70,9 @@ function promptYesOrNo () {
7270function performEject ( pkg ) {
7371 // Copy the configuration and start/build scripts.
7472 try {
75- copySync ( path . resolve ( __dirname , 'build.js' ) , './scripts/build.js' ) ;
76- copySync ( path . resolve ( __dirname , 'start.js' ) , './scripts/start.js' ) ;
77- copySync ( path . resolve ( __dirname , '../config' ) , './config' ) ;
73+ fs . copySync ( path . resolve ( __dirname , 'build.js' ) , './scripts/build.js' ) ;
74+ fs . copySync ( path . resolve ( __dirname , 'start.js' ) , './scripts/start.js' ) ;
75+ fs . copySync ( path . resolve ( __dirname , '../config' ) , './config' ) ;
7876 } catch ( err ) {
7977 console . log ( chalk . red ( 'Failed to copy scripts, the error is:\n' ) ) ;
8078 console . log ( err ) ;
@@ -100,7 +98,6 @@ function performEject (pkg) {
10098const unusedDependencies = [
10199 'cross-spawn' ,
102100 'fs-extra' ,
103- 'minimist' ,
104101 'cli-table' ,
105102 'extend' ,
106103 'prompt' ,
@@ -117,12 +114,12 @@ const scripts = {
117114 test : 'elm-test'
118115} ;
119116
120- if ( pathExists . sync ( 'elm-package.json' ) === false ) {
117+ if ( fs . existsSync ( 'elm-package.json' ) === false ) {
121118 console . log ( 'Please, run the eject script from project root directory' ) ;
122119 process . exit ( 1 ) ;
123120}
124121
125- if ( pathExists . sync ( './package.json' ) === true ) {
122+ if ( fs . existsSync ( './package.json' ) === true ) {
126123 console . log ( 'Found existing package.json' ) ;
127124 var pkgEjected = JSON . parse ( fs . readFileSync ( './package.json' , { encoding : 'utf-8' } ) ) ;
128125
0 commit comments