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
This commit is contained in:
Joel Marcey 2017-10-26 12:09:12 -07:00 committed by GitHub
parent fb294ab845
commit ae08fa31d6

View file

@ -33,7 +33,7 @@ const program = require("commander");
program.option("--port <number>", "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")