Skip to content

Commit cf67869

Browse files
committed
fix: .env not bundled + create build/ directory
1 parent 6957ce6 commit cf67869

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Commands/BundleCommand.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,18 @@ private function addFilesToZip(ZipArchive $zip): void
168168
'node_modules', // We add this later
169169
'dist', // Compiled nativephp assets
170170
'build', // Compiled box assets
171+
'temp', // Temp files
171172
'tests', // Tests
172173
...config('nativephp.cleanup_exclude_files', []), // User defined
173174
]);
174175

175176
$this->finderToZip($app, $zip);
176177

178+
// Add .env file
179+
$zip->addFile(base_path('.env'), '.env');
180+
177181
$vendor = (new Finder)->files()
178-
// ->followLinks()
182+
// ->followLinks() // This is causing issues with excluded files
179183
->exclude(array_filter([
180184
'nativephp/php-bin',
181185
'nativephp/electron/resources/js',
@@ -233,6 +237,8 @@ private function checkAuthenticated()
233237

234238
private function fetchLatestBundle(): bool
235239
{
240+
$this->line('Fetching latest bundle…');
241+
236242
$response = Http::acceptJson()
237243
->withToken(config('nativephp-internal.zephpyr.token'))
238244
->get($this->baseUrl().'api/v1/project/'.$this->key.'/build/download');
@@ -241,6 +247,7 @@ private function fetchLatestBundle(): bool
241247
return false;
242248
}
243249

250+
@mkdir(base_path('build'), recursive: true);
244251
file_put_contents(base_path('build/__nativephp_app_bundle'), $response->body());
245252

246253
return true;

0 commit comments

Comments
 (0)