Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions lib/utils/develop.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,15 +192,19 @@ function startServer (program) {
}

module.exports = (program) => {
detect(program.port, (err, _port) => {
const port = typeof program.port === 'string'
? parseInt(program.port, 10)
: program.port

detect(port, (err, _port) => {
if (err) {
console.error(err)
process.exit()
}

if (program.port !== _port) {
if (port !== _port) {
// eslint-disable-next-line max-len
const question = `Something is already running at port ${program.port} \nWould you like to run the app at another port instead? [Y/n] `
const question = `Something is already running at port ${port} \nWould you like to run the app at another port instead? [Y/n] `

return rlInterface.question(question, (answer) => {
if (answer.length === 0 || answer.match(/^yes|y$/i)) {
Expand Down