Skip to content

Commit 7079649

Browse files
committed
feat: public config files from core package to storage with provider
1 parent 545049a commit 7079649

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

config/telegram-git-notifier.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
<?php
22

3+
$configFileStorageFolder = env(
4+
'TGN_CONFIG_FILE_STORAGE_FOLDER',
5+
storage_path('/app/vendor/tg-notifier/jsons')
6+
);
7+
38
return [
49
'defaults' => [
510
'paths' => [
@@ -50,19 +55,21 @@
5055

5156
/** Set the path to the data file */
5257
'data_file' => [
58+
'storage_folder' => $configFileStorageFolder,
59+
5360
'setting' => env(
5461
'TGN_PATH_SETTING',
55-
storage_path('/app/json/tgn/tgn-settings.json')
62+
$configFileStorageFolder.'/tgn-settings.json'
5663
),
5764

5865
'platform' => [
5966
'gitlab' => env(
6067
'TGN_PATH_PLATFORM_GITLAB',
61-
storage_path('/app/json/tgn/gitlab-events.json')
68+
$configFileStorageFolder.'/gitlab-events.json'
6269
),
6370
'github' => env(
6471
'TGN_PATH_PLATFORM_GITHUB',
65-
storage_path('/app/json/tgn/github-events.json')
72+
$configFileStorageFolder.'/github-events.json'
6673
),
6774
],
6875
],

src/Providers/TelegramGitNotifierServiceProvider.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ public function boot(): void
3737
$this->publishes([
3838
__DIR__.'/../../lang' => resource_path('lang/vendor/tg-notifier'),
3939
], 'lang');
40+
41+
// copy config jsons from core package and ensure permissions are correct
42+
$this->publishes([
43+
__DIR__.'/../../../telegram-git-notifier/config/jsons' => config('telegram-git-notifier.data_file.storage_folder'),
44+
], 'config_jsons');
4045
}
4146

4247
/**

0 commit comments

Comments
 (0)