2
2
3
3
namespace CSlant \LaravelTelegramGitNotifier \Providers ;
4
4
5
+ use CSlant \LaravelTelegramGitNotifier \Commands \ChangeOwnerConfigJson ;
5
6
use Illuminate \Support \ServiceProvider ;
6
7
7
8
class TelegramGitNotifierServiceProvider extends ServiceProvider
@@ -25,27 +26,9 @@ public function boot(): void
25
26
26
27
$ this ->loadTranslationsFrom (__DIR__ .'/../../lang ' , 'tg-notifier ' );
27
28
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 ();
40
30
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 ();
49
32
}
50
33
51
34
/**
@@ -68,4 +51,37 @@ public function provides(): ?array
68
51
{
69
52
return ['telegram-git-notifier ' ];
70
53
}
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
+ }
71
87
}
0 commit comments