Skip to content

Commit

Permalink
Merge pull request #7 from PhpGt/6-run-port
Browse files Browse the repository at this point in the history
Change server port when calling "run" command
  • Loading branch information
g105b authored May 10, 2020
2 parents 4b4a2e2 + dad0568 commit fe955c3
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/Command/RunCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@

class RunCommand extends AbstractWebEngineCommand {
public function run(ArgumentValueList $arguments = null):void {
$port = $arguments->get("port", 8080);
$bind = $arguments->get("bind", "0.0.0.0");

$this->executeScript(
$arguments,
["serve"],
["serve", "--port", $port, "--bind", $bind],
["build", "--default", "vendor/phpgt/webengine/build.default.json", "--watch"],
["cron", "--now", "--watch"]
);
Expand Down Expand Up @@ -40,6 +43,17 @@ public function getRequiredParameterList():array {

/** @return Parameter[] */
public function getOptionalParameterList():array {
return [];
return [
new Parameter(
true,
"port",
"p"
),
new Parameter(
true,
"bind",
"b"
),
];
}
}

0 comments on commit fe955c3

Please sign in to comment.