File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ const start = function (file) {
3131 let port = program . port ,
3232 host = program . host || '127.0.0.1' ,
3333 dbname = program . dbname || '-deployd' ,
34- mongoPort = generatePort ( ) ,
34+ mongoPort = program . mongoPort ? Number ( program . mongoPort ) : '27017' ,
3535 env = program . environment || process . env . DPD_ENV || 'development' ,
3636 retries = 0 ,
3737 credentials = { } ;
@@ -42,10 +42,6 @@ const start = function (file) {
4242 retries = env === 'development' && 5 ;
4343 }
4444
45- if ( program . mongoPort ) {
46- mongoPort = Number ( program . mongoPort ) ;
47- }
48-
4945 if ( file ) {
5046 process . chdir ( path . dirname ( file ) ) ;
5147 }
@@ -170,14 +166,6 @@ const start = function (file) {
170166 }
171167} ;
172168
173- /**
174- * Port generation
175- */
176- function generatePort ( ) {
177- const portRange = [ 3000 , 9000 ] ;
178- return Math . floor ( Math . random ( ) * ( portRange [ 1 ] - portRange [ 0 ] ) ) + portRange [ 0 ] ;
179- }
180-
181169function checkForUpdates ( ) {
182170 http . get ( 'http://registry.npmjs.org/deployd-cli' , ( err , res , body ) => {
183171 if ( ! err ) {
You can’t perform that action at this time.
0 commit comments