@@ -192,40 +192,6 @@ var startMongo = function (args, port, silent) {
192192 } ) ;
193193} ;
194194
195- const startLocal = function ( serverCommand ) {
196- let stdout , workerJob = null ;
197- const env = { cwd : path . join ( __dirname , '..' ) , NODE_ENV : process . env . NODE_ENV , PATH : process . env . PATH } ;
198- // Set the cache to the blob
199- if ( gmeConfig . blob . type === 'FS' ) {
200- process . env . DEEPFORGE_WORKER_CACHE = path . resolve ( gmeConfig . blob . fsDir + '/wg-content' ) ;
201- }
202-
203- // process.env.NODE_ENV = 'local';
204- const execJob = rawSpawn ( serverCommand , [
205- path . join ( __dirname , '..' , 'app.js' )
206- ] , {
207- env : env ,
208- shell : SHELL
209- } ) ;
210-
211- execJob . stdout . pipe ( process . stdout ) ;
212- execJob . stderr . pipe ( process . stderr ) ;
213-
214- execJob . stdout . on ( 'data' , function ( chunk ) {
215- if ( ! workerJob ) {
216- stdout += chunk ;
217- if ( stdout . indexOf ( 'DeepForge' ) > - 1 ) {
218- workerJob = rawSpawn ( 'npm' , [ 'run' , 'worker' ] , env ) ;
219- workerJob . stdout . pipe ( process . stdout ) ;
220- workerJob . stderr . pipe ( process . stderr ) ;
221- workerJob . on ( 'close' , code => code && process . exit ( code ) ) ;
222- }
223- }
224- } ) ;
225-
226- execJob . on ( 'close' , code => code && process . exit ( code ) ) ;
227- } ;
228-
229195var spawn = function ( cmd , args , opts ) {
230196 var deferred = Q . defer ( ) ,
231197 job ,
@@ -278,6 +244,11 @@ program.command('start')
278244 . option ( '-m, --mongo' , 'start MongoDB' )
279245 . action ( async args => {
280246 const serverCommand = getDeepForgeServerCommand ( args . conda ) ;
247+ const startAll = ! args . server && ! args . mongo ;
248+ if ( startAll ) {
249+ args . server = true ;
250+ args . mongo = true ;
251+ }
281252
282253 if ( args . port ) {
283254 process . env . PORT = args . port ;
@@ -294,12 +265,6 @@ program.command('start')
294265 shell : SHELL
295266 } ) ;
296267 }
297-
298- const startAll = ! args . server && ! args . mongo ;
299- if ( startAll ) {
300- await checkMongo ( args ) ;
301- startLocal ( serverCommand ) ;
302- }
303268 } ) ;
304269
305270// update
0 commit comments