Skip to content

Commit

Permalink
Improve Publish command
Browse files Browse the repository at this point in the history
  • Loading branch information
simonhamp authored Apr 30, 2024
1 parent 2fdd6ae commit 3ed2228
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Commands/PublishCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,16 @@ public function handle(): void
echo $output;
});

$buildCommand = 'npm run build';
if ($this->argument('os')) {
$buildCommand .= ':'.$this->argument('os');
}

Process::path(__DIR__.'/../../resources/js/')
->env($this->getEnvironmentVariables())
->forever()
->tty(PHP_OS_FAMILY != 'Windows' && ! $this->option('no-interaction'))
->run('npm run publish:mac-arm', function (string $type, string $output) {
->run($buildCommand, function (string $type, string $output) {
echo $output;
});
}
Expand All @@ -45,6 +50,7 @@ protected function getEnvironmentVariables(): array
[
'APP_PATH' => base_path(),
'NATIVEPHP_BUILDING' => true,
'NATIVEPHP_PHP_BINARY_VERSION' => PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION,
'NATIVEPHP_PHP_BINARY_PATH' => base_path($this->phpBinaryPath()),
'NATIVEPHP_CERTIFICATE_FILE_PATH' => base_path($this->binaryPackageDirectory().'cacert.pem'),
'NATIVEPHP_APP_NAME' => config('app.name'),
Expand Down

0 comments on commit 3ed2228

Please sign in to comment.