Skip to content

Commit

Permalink
Merge pull request #19 from Zaryabakhtar/main
Browse files Browse the repository at this point in the history
Allow Users to Set Environment Variables
  • Loading branch information
dcblogdev authored May 2, 2024
2 parents 6b14035 + 20e532f commit 8025622
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions config/dbsync.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,15 @@
'targetConnection' => env('LOCAL_TARGET_CONNECTION', 'mysql'),

'mysqldumpSkipTzUtc' => env('REMOTE_MYSQLDUMP_SKIP_TZ_UTC', false),


/*
* List all the environment variables that need to be set for the command to work
*/
'environments' => [
'local',
'staging'
],

'localMysqlPath' => env('LOCAL_MYSQL_PATH', '/usr/local/bin/mysql'),
];
2 changes: 1 addition & 1 deletion src/Console/DbSyncCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function handle(): bool
{
$inTest = $this->option('test');

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

return true;
Expand Down

0 comments on commit 8025622

Please sign in to comment.