Skip to content

Commit 1d88e33

Browse files
authored
Merge pull request #22 from tanhongit/develop
feat: public config files from core package to storage with provider
2 parents 545049a + 7328413 commit 1d88e33

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

config/telegram-git-notifier.php

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

3+
$configFileStorageFolder = storage_path(
4+
env('TGN_CONFIG_FILE_STORAGE_FOLDER', '/app/vendor/tg-notifier/jsons')
5+
);
6+
37
return [
48
'defaults' => [
59
'paths' => [
@@ -50,19 +54,21 @@
5054

5155
/** Set the path to the data file */
5256
'data_file' => [
57+
'storage_folder' => $configFileStorageFolder,
58+
5359
'setting' => env(
5460
'TGN_PATH_SETTING',
55-
storage_path('/app/json/tgn/tgn-settings.json')
61+
$configFileStorageFolder.'/tgn-settings.json'
5662
),
5763

5864
'platform' => [
5965
'gitlab' => env(
6066
'TGN_PATH_PLATFORM_GITLAB',
61-
storage_path('/app/json/tgn/gitlab-events.json')
67+
$configFileStorageFolder.'/gitlab-events.json'
6268
),
6369
'github' => env(
6470
'TGN_PATH_PLATFORM_GITHUB',
65-
storage_path('/app/json/tgn/github-events.json')
71+
$configFileStorageFolder.'/github-events.json'
6672
),
6773
],
6874
],

phpstan.neon.dist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ parameters:
66
paths:
77
- src
88
- routes
9-
- config
109
tmpDir: build/phpstan
1110
checkOctaneCompatibility: true
1211
checkModelProperties: true

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)