From ae08fa31d6d44e994cd5a779b9adf0ba4da7483b Mon Sep 17 00:00:00 2001 From: Joel Marcey Date: Thu, 26 Oct 2017 12:09:12 -0700 Subject: [PATCH] Fix custom port number parsing... (#187) * Fix custom port number parsing... Checking if a port was in use raised a bug where the port coming in from the command line is a string and not an int. And that was causing the check to fail. Make the port an int from the get go * Specifiy radix --- lib/start-server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/start-server.js b/lib/start-server.js index dc5491bfa1..fcc49acfc9 100755 --- a/lib/start-server.js +++ b/lib/start-server.js @@ -33,7 +33,7 @@ const program = require("commander"); program.option("--port ", "Specify port number").parse(process.argv); -const port = program.port || 3000; +const port = parseInt(program.port, 10) || 3000; console.log("Checking if port " + port + " is free..."); tcpPortUsed.check(port, "localhost")