Skip to content

Commit 8025622

Browse files
authored
Merge pull request #19 from Zaryabakhtar/main
Allow Users to Set Environment Variables
2 parents 6b14035 + 20e532f commit 8025622

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

config/dbsync.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,15 @@
7373
'targetConnection' => env('LOCAL_TARGET_CONNECTION', 'mysql'),
7474

7575
'mysqldumpSkipTzUtc' => env('REMOTE_MYSQLDUMP_SKIP_TZ_UTC', false),
76+
77+
78+
/*
79+
* List all the environment variables that need to be set for the command to work
80+
*/
81+
'environments' => [
82+
'local',
83+
'staging'
84+
],
7685

7786
'localMysqlPath' => env('LOCAL_MYSQL_PATH', '/usr/local/bin/mysql'),
7887
];

src/Console/DbSyncCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public function handle(): bool
1414
{
1515
$inTest = $this->option('test');
1616

17-
if (! in_array(config('app.env'), ['local', 'staging'])) {
17+
if (! in_array(config('app.env'), config('dbsync.environments'))) {
1818
$this->error('DB sync will only run on local and staging environments');
1919

2020
return true;

0 commit comments

Comments
 (0)