mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-22 01:29:04 +01:00
server-main.js should respect the --port argument (#161254)
After https://github.com/microsoft/vscode/pull/160094 merged, `server-main.js` ignores the `--port` argument. This patch fixes the problem.
This commit is contained in:
committed by
GitHub
parent
63c8b91c18
commit
95bf25f800
@@ -188,14 +188,10 @@ function sanitizeStringArg(val) {
|
||||
* @throws
|
||||
*/
|
||||
async function parsePort(host, strPort) {
|
||||
let specificPort;
|
||||
if (strPort) {
|
||||
let range;
|
||||
if (strPort.match(/^\d+$/)) {
|
||||
specificPort = parseInt(strPort, 10);
|
||||
if (specificPort === 0) {
|
||||
return specificPort;
|
||||
}
|
||||
return parseInt(strPort, 10);
|
||||
} else if (range = parseRange(strPort)) {
|
||||
const port = await findFreePort(host, range.start, range.end);
|
||||
if (port !== undefined) {
|
||||
|
||||
Reference in New Issue
Block a user