22
33namespace CSlant \LaravelTelegramGitNotifier \Providers ;
44
5+ use CSlant \LaravelTelegramGitNotifier \Commands \ChangeOwnerConfigJson ;
56use Illuminate \Support \ServiceProvider ;
67
78class TelegramGitNotifierServiceProvider extends ServiceProvider
@@ -25,27 +26,9 @@ public function boot(): void
2526
2627 $ this ->loadTranslationsFrom (__DIR__ .'/../../lang ' , 'tg-notifier ' );
2728
28- $ configPath = __DIR__ .'/../../config/telegram-git-notifier.php ' ;
29- $ this ->publishes ([
30- $ configPath => config_path ('telegram-git-notifier.php ' ),
31- ], 'config ' );
32-
33- $ this ->publishes ([
34- __DIR__ .'/../../resources/views ' => config ('telegram-git-notifier.defaults.paths.views ' ),
35- ], 'views ' );
36-
37- $ this ->publishes ([
38- __DIR__ .'/../../lang ' => resource_path ('lang/vendor/tg-notifier ' ),
39- ], 'lang ' );
29+ $ this ->registerCommands ();
4030
41- $ this ->publishes ([
42- __DIR__ .'/../../../telegram-git-notifier/config/jsons ' => config ('telegram-git-notifier.data_file.storage_folder ' ),
43- ], 'config_jsons ' );
44-
45- $ jsonsPath = config ('telegram-git-notifier.data_file.storage_folder ' );
46- if (is_string ($ jsonsPath ) && file_exists ($ jsonsPath )) {
47- exec ("chown -R www-data:www-data $ jsonsPath " );
48- }
31+ $ this ->registerAssetPublishing ();
4932 }
5033
5134 /**
@@ -68,4 +51,37 @@ public function provides(): ?array
6851 {
6952 return ['telegram-git-notifier ' ];
7053 }
54+
55+ /**
56+ * @return void
57+ */
58+ protected function registerCommands (): void
59+ {
60+ $ this ->commands ([
61+ ChangeOwnerConfigJson::class,
62+ ]);
63+ }
64+
65+ /**
66+ * @return void
67+ */
68+ protected function registerAssetPublishing (): void
69+ {
70+ $ configPath = __DIR__ .'/../../config/telegram-git-notifier.php ' ;
71+ $ this ->publishes ([
72+ $ configPath => config_path ('telegram-git-notifier.php ' ),
73+ ], 'config ' );
74+
75+ $ this ->publishes ([
76+ __DIR__ .'/../../resources/views ' => config ('telegram-git-notifier.defaults.paths.views ' ),
77+ ], 'views ' );
78+
79+ $ this ->publishes ([
80+ __DIR__ .'/../../lang ' => resource_path ('lang/vendor/tg-notifier ' ),
81+ ], 'lang ' );
82+
83+ $ this ->publishes ([
84+ __DIR__ .'/../../../telegram-git-notifier/config/jsons ' => config ('telegram-git-notifier.data_file.storage_folder ' ),
85+ ], 'config_jsons ' );
86+ }
7187}
0 commit comments