Skip to content

Commit

Permalink
Merge pull request #22 from tanhongit/develop
Browse files Browse the repository at this point in the history
feat: public config files from core package to storage with provider
  • Loading branch information
tanhongit authored Nov 16, 2023
2 parents 545049a + 7328413 commit 1d88e33
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
12 changes: 9 additions & 3 deletions config/telegram-git-notifier.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?php

$configFileStorageFolder = storage_path(
env('TGN_CONFIG_FILE_STORAGE_FOLDER', '/app/vendor/tg-notifier/jsons')
);

return [
'defaults' => [
'paths' => [
Expand Down Expand Up @@ -50,19 +54,21 @@

/** Set the path to the data file */
'data_file' => [
'storage_folder' => $configFileStorageFolder,

'setting' => env(
'TGN_PATH_SETTING',
storage_path('/app/json/tgn/tgn-settings.json')
$configFileStorageFolder.'/tgn-settings.json'
),

'platform' => [
'gitlab' => env(
'TGN_PATH_PLATFORM_GITLAB',
storage_path('/app/json/tgn/gitlab-events.json')
$configFileStorageFolder.'/gitlab-events.json'
),
'github' => env(
'TGN_PATH_PLATFORM_GITHUB',
storage_path('/app/json/tgn/github-events.json')
$configFileStorageFolder.'/github-events.json'
),
],
],
Expand Down
1 change: 0 additions & 1 deletion phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ parameters:
paths:
- src
- routes
- config
tmpDir: build/phpstan
checkOctaneCompatibility: true
checkModelProperties: true
Expand Down
5 changes: 5 additions & 0 deletions src/Providers/TelegramGitNotifierServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ public function boot(): void
$this->publishes([
__DIR__.'/../../lang' => resource_path('lang/vendor/tg-notifier'),
], 'lang');

// copy config jsons from core package and ensure permissions are correct
$this->publishes([
__DIR__.'/../../../telegram-git-notifier/config/jsons' => config('telegram-git-notifier.data_file.storage_folder'),
], 'config_jsons');
}

/**
Expand Down

0 comments on commit 1d88e33

Please sign in to comment.