Skip to content

Commit

Permalink
fix port detection in cms
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarotero committed May 27, 2024
1 parent e6f3b66 commit fe53943
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/utils/cli_options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,19 @@ export function getOptionsFromCli(
options.dest = cli.dest;
}

const serveMode = cli.serve || cli._[0] === "cms";

if (cli.port) {
(options.server ||= {}).port = parseInt(cli.port);
} else if (cli.serve) {
} else if (serveMode) {
(options.server ||= {}).port = 3000;
}

let location: URL;

if (cli.location) {
location = new URL(cli.location);
} else if (options.location && !cli.server) {
} else if (options.location && !serveMode) {
location = options.location as URL;
} else {
location = new URL("http://localhost");
Expand Down

0 comments on commit fe53943

Please sign in to comment.