Skip to content

Commit

Permalink
fix: install command broken
Browse files Browse the repository at this point in the history
  • Loading branch information
BernhardBaumrock committed Jan 18, 2024
1 parent a242249 commit 343b795
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions App/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -399,14 +399,23 @@ public function trailingSlash($path)

/**
* Get wire instance
* @return ProcessWire
* @return ProcessWire|false
*/
public function wire()
{
if ($this->wire) return $this->wire;
chdir($this->app->rootPath());
include 'index.php';
return $this->wire = $wire;

// pw is not yet there, eg when using pw:install
if (!is_file("index.php")) return false;

try {
include 'index.php';
return $this->wire = $wire;
} catch (\Throwable $th) {
echo $th->getMessage() . "\n";
return false;
}
}

/**
Expand Down

0 comments on commit 343b795

Please sign in to comment.