Skip to content

Commit 368b8e0

Browse files
authored
feat: bun package install/build (#439)
1 parent 4437721 commit 368b8e0

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/NewCommand.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -506,23 +506,29 @@ protected function execute(InputInterface $input, OutputInterface $output): int
506506
}
507507

508508
$packageInstall = 'npm install';
509+
$packageBuild = 'npm run build';
509510

510511
if (file_exists($directory.'/pnpm-lock.yaml')) {
511512
$packageInstall = 'pnpm install';
513+
$packageBuild = 'pnpm run build';
512514
} elseif (file_exists($directory.'/yarn.lock')) {
513515
$packageInstall = 'yarn install';
516+
$packageBuild = 'yarn run build';
517+
} elseif (file_exists($directory.'/bun.lock')) {
518+
$packageInstall = 'bun install';
519+
$packageBuild = 'bun run build';
514520
}
515521

516522
$runNpm = $input->getOption('npm');
517523

518524
if (! $input->getOption('npm') && $input->isInteractive()) {
519525
$runNpm = confirm(
520-
label: 'Would you like to run <options=bold>'.$packageInstall.'</> and <options=bold>npm run build</>?'
526+
label: 'Would you like to run <options=bold>'.$packageInstall.'</> and <options=bold>'.$packageBuild.'</>?'
521527
);
522528
}
523529

524530
if ($runNpm) {
525-
$this->runCommands([$packageInstall, 'npm run build'], $input, $output, workingPath: $directory);
531+
$this->runCommands([$packageInstall, $packageBuild], $input, $output, workingPath: $directory);
526532
}
527533

528534
$output->writeln(" <bg=blue;fg=white> INFO </> Application ready in <options=bold>[{$name}]</>. You can start your local development using:".PHP_EOL);

0 commit comments

Comments
 (0)