Skip to content

Commit 08a3726

Browse files
committed
feat: native:bundle --clear
1 parent 2bdf295 commit 08a3726

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

src/Commands/BundleCommand.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class BundleCommand extends Command
3131
use PrunesVendorDirectory;
3232
use SetsAppName;
3333

34-
protected $signature = 'native:bundle {--fetch} {--without-cleanup}';
34+
protected $signature = 'native:bundle {--fetch} {--clear} {--without-cleanup}';
3535

3636
protected $description = 'Bundle your application for distribution.';
3737

@@ -43,6 +43,17 @@ class BundleCommand extends Command
4343

4444
public function handle(): int
4545
{
46+
// Remove the bundle
47+
if ($this->option('clear')) {
48+
if (file_exists(base_path('build/__nativephp_app_bundle'))) {
49+
unlink(base_path('build/__nativephp_app_bundle'));
50+
}
51+
52+
$this->info('Bundle removed. Building in this state would be unsecure.');
53+
54+
return static::SUCCESS;
55+
}
56+
4657
// Check for ZEPHPYR_KEY
4758
if (! $this->checkForZephpyrKey()) {
4859
return static::FAILURE;

src/Traits/HandleApiRequests.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
use Illuminate\Support\Facades\Http;
66

7+
use function Laravel\Prompts\intro;
8+
79
trait HandleApiRequests
810
{
911
private function baseUrl(): string
@@ -13,7 +15,7 @@ private function baseUrl(): string
1315

1416
private function checkAuthenticated()
1517
{
16-
$this->line('Checking authentication…');
18+
intro('Checking authentication…');
1719

1820
return Http::acceptJson()
1921
->withToken(config('nativephp-internal.zephpyr.token'))

0 commit comments

Comments
 (0)