File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change 1111use Native \Desktop \Drivers \Electron \Commands \PublishCommand ;
1212use Native \Desktop \Drivers \Electron \Commands \ResetCommand ;
1313use Native \Desktop \Drivers \Electron \Updater \UpdaterManager ;
14+ use Native \Desktop \Support \Composer ;
1415use Spatie \LaravelPackageTools \Package ;
1516use Spatie \LaravelPackageTools \PackageServiceProvider ;
1617
1718class ElectronServiceProvider extends PackageServiceProvider
1819{
19- const ELECTRON_PATH = __DIR__ .'/../../../resources/electron ' ;
20+ public static function electronPath (string $ path = '' )
21+ {
22+ // Will use the published electron project, or fallback to the vendor default
23+ $ publishedProjectPath = base_path ("nativephp/electron/ {$ path }" );
24+
25+ return is_dir ($ publishedProjectPath )
26+ ? $ publishedProjectPath
27+ : Composer::desktopPackagePath ("resources/electron/ {$ path }" );
28+ }
29+
30+ public static function buildPath (string $ path = '' )
31+ {
32+ return Composer::desktopPackagePath ("resources/build/ {$ path }" );
33+ }
2034
2135 public function configurePackage (Package $ package ): void
2236 {
@@ -40,7 +54,7 @@ public function packageRegistered(): void
4054
4155 $ this ->app ->bind (Builder::class, function () {
4256 return Builder::make (
43- buildPath: self ::ELECTRON_PATH . ' /resources/ app '
57+ buildPath: self ::buildPath ( ' app ')
4458 );
4559 });
4660 }
You can’t perform that action at this time.
0 commit comments