Skip to content

Commit fdda1de

Browse files
authored
Support --no-interaction in native:serve command (#119)
* cleanup * add flag * Fix styling --------- Co-authored-by: simonhamp <[email protected]>
1 parent fb234e7 commit fdda1de

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

src/Commands/DevelopCommand.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ public function handle(): void
2525
if (! $this->option('no-dependencies')) {
2626
$this->installNPMDependencies(
2727
force: ! $this->option('no-dependencies'),
28-
installer: $this->option('installer')
28+
installer: $this->option('installer'),
29+
withoutInteraction: $this->option('no-interaction')
2930
);
3031
}
3132

@@ -39,7 +40,11 @@ public function handle(): void
3940

4041
$this->installIcon();
4142

42-
$this->runDeveloper(installer: $this->option('installer'), skip_queue: $this->option('no-queue'), withoutInteraction: $this->option('no-interaction'));
43+
$this->runDeveloper(
44+
installer: $this->option('installer'),
45+
skip_queue: $this->option('no-queue'),
46+
withoutInteraction: $this->option('no-interaction')
47+
);
4348
}
4449

4550
/**

src/Traits/Developer.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ protected function runDeveloper(string $installer, bool $skip_queue, bool $witho
1313
[$installer, $command] = $this->getInstallerAndCommand(installer: $installer, type: 'dev');
1414

1515
note("Running the dev script with {$installer}...");
16-
$this->executeCommand(command: $command, skip_queue: $skip_queue, type: 'serve', withoutInteraction: $withoutInteraction);
16+
17+
$this->executeCommand(
18+
command: $command,
19+
skip_queue: $skip_queue,
20+
type: 'serve',
21+
withoutInteraction: $withoutInteraction
22+
);
1723
}
1824
}

src/Traits/ExecuteCommand.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,12 @@ trait ExecuteCommand
1111
{
1212
use LocatesPhpBinary;
1313

14-
protected function executeCommand(string $command, bool $skip_queue = false, string $type = 'install', bool $withoutInteraction = false): void
15-
{
14+
protected function executeCommand(
15+
string $command,
16+
bool $skip_queue = false,
17+
string $type = 'install',
18+
bool $withoutInteraction = false
19+
): void {
1620
$envs = [
1721
'install' => [
1822
'NATIVEPHP_PHP_BINARY_VERSION' => PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION,
@@ -30,6 +34,7 @@ protected function executeCommand(string $command, bool $skip_queue = false, str
3034
];
3135

3236
note('Fetching latest dependencies…');
37+
3338
Process::path(__DIR__.'/../../resources/js/')
3439
->env($envs[$type])
3540
->forever()

0 commit comments

Comments
 (0)