@@ -20,20 +20,20 @@ public function handle(Package $package): void
20
20
$ storagePath = storage_path ('app/public/package-og-images ' );
21
21
$ this ->ensureDir ($ storagePath );
22
22
23
- $ filename = Str::slug ($ package ->name ) . '- ' . Str::random (8 ) . '.jpg ' ;
24
- $ fullPath = $ storagePath . '/ ' . $ filename ;
23
+ $ filename = Str::slug ($ package ->name ). '- ' . Str::random (8 ). '.jpg ' ;
24
+ $ fullPath = $ storagePath. '/ ' . $ filename ;
25
25
26
26
// Binaries
27
27
$ nodePath = $ this ->which ('node ' ) ?? '/usr/bin/node ' ;
28
- $ npmPath = $ this ->which ('npm ' ) ?? '/usr/bin/npm ' ;
28
+ $ npmPath = $ this ->which ('npm ' ) ?? '/usr/bin/npm ' ;
29
29
30
30
// Writable Chrome profile/cache dir
31
31
$ userDataDir = rtrim ((string ) env ('BROWSERSHOT_USER_DATA_DIR ' , '/var/www/browsershot-cache ' ), '/ ' );
32
32
$ this ->ensureDir ($ userDataDir );
33
33
34
34
// Ensure the env seen by the child process points to our writable dir
35
35
foreach (['HOME ' , 'XDG_CONFIG_HOME ' , 'XDG_CACHE_HOME ' ] as $ var ) {
36
- putenv ($ var . '= ' . $ userDataDir );
36
+ putenv ($ var. '= ' . $ userDataDir );
37
37
$ _ENV [$ var ] = $ userDataDir ;
38
38
$ _SERVER [$ var ] = $ userDataDir ;
39
39
}
@@ -79,12 +79,12 @@ public function handle(Package $package): void
79
79
->usingFileName ($ filename )
80
80
->toMediaCollection ('og-images ' , 'package-og-images ' );
81
81
82
- Log::info ('OG Image Generated: ' . $ package ->getFirstMediaUrl ('og-images ' ));
82
+ Log::info ('OG Image Generated: ' . $ package ->getFirstMediaUrl ('og-images ' ));
83
83
} else {
84
84
Log::error ('OG image file missing after save ' , ['path ' => $ fullPath ]);
85
85
}
86
86
} catch (\Throwable $ e ) {
87
- Log::error ('OG Image Generation Error: ' . $ e ->getMessage (), ['exception ' => $ e ]);
87
+ Log::error ('OG Image Generation Error: ' . $ e ->getMessage (), ['exception ' => $ e ]);
88
88
throw $ e ;
89
89
}
90
90
}
@@ -99,6 +99,7 @@ private function ensureDir(string $dir): void
99
99
private function which (string $ bin ): ?string
100
100
{
101
101
$ path = @exec (sprintf ('command -v %s ' , escapeshellarg ($ bin )));
102
+
102
103
return $ path ?: null ;
103
104
}
104
105
0 commit comments