Skip to content

Commit c413f9e

Browse files
committed
feat: update owner config json command to enable change in both the user and the group
1 parent e4d384a commit c413f9e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/Commands/ChangeOwnerConfigJson.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ class ChangeOwnerConfigJson extends Command
1111
*
1212
* @var string
1313
*/
14-
protected $signature = 'config-json:change-owner {--user= : user}';
14+
protected $signature = 'config-json:change-owner
15+
{user : The user to change owner}
16+
{group? : The group to change owner}';
1517

1618
/**
1719
* The console command description.
@@ -27,10 +29,12 @@ class ChangeOwnerConfigJson extends Command
2729
*/
2830
public function handle(): void
2931
{
30-
$user = $this->option('user');
32+
$user = $this->argument('user');
33+
$group = $this->argument('group') ?? $user;
34+
3135
$jsonsPath = config('telegram-git-notifier.data_file.storage_folder');
3236
if (is_string($jsonsPath) && file_exists($jsonsPath)) {
33-
exec("chown -R $user:$user $jsonsPath");
37+
exec("chown -R $user:$group $jsonsPath");
3438
}
3539
}
3640
}

0 commit comments

Comments
 (0)