forked from cslant/laravel-telegram-git-notifier
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create command set config json for owner
- Loading branch information
Showing
2 changed files
with
72 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace CSlant\LaravelTelegramGitNotifier\Commands; | ||
|
||
use Illuminate\Console\Command; | ||
|
||
class SetConfigJsonOwner extends Command | ||
{ | ||
/** | ||
* The name and signature of the console command. | ||
* | ||
* @var string | ||
*/ | ||
protected $signature = 'config-json:change-owner {--user= : user}'; | ||
|
||
/** | ||
* The console command description. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = 'config-json'; | ||
|
||
/** | ||
* Execute the console command. | ||
* | ||
* @return void | ||
*/ | ||
public function handle(): void | ||
{ | ||
$user = $this->option('user'); | ||
$jsonsPath = config('telegram-git-notifier.data_file.storage_folder'); | ||
if (is_string($jsonsPath) && file_exists($jsonsPath)) { | ||
exec("chown -R $user:$user $jsonsPath"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters