File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -35,16 +35,27 @@ public function handle(): void
3535 return ;
3636 }
3737
38- $ user = $ this ->argument ('user ' );
38+ $ user = $ this ->argument ('user ' ) ?? $ this -> getDefaultUserGroup () ;
3939 $ group = $ this ->argument ('group ' ) ?? $ user ;
4040
41- if (! is_string ($ user ) || ! is_string ($ group )) {
41+ if (empty ($ user ) || empty ($ group )) {
4242 $ user = $ group = $ this ->getDefaultUserGroup ();
4343 }
4444
45+ $ this ->changeOwner ($ user , $ group );
46+ }
47+
48+ /**
49+ * @param string $user
50+ * @param string $group
51+ *
52+ * @return void
53+ */
54+ private function changeOwner (string $ user , string $ group ): void
55+ {
4556 $ jsonsPath = config ('telegram-git-notifier.data_file.storage_folder ' );
4657 if (is_string ($ jsonsPath ) && file_exists ($ jsonsPath )) {
47- shell_exec (" chown -R " .escapeshellarg ($ user )." : " .escapeshellarg ($ group )." " .escapeshellarg ($ jsonsPath ));
58+ shell_exec (' chown -R ' .escapeshellarg ($ user ).' : ' .escapeshellarg ($ group ).' ' .escapeshellarg ($ jsonsPath ));
4859 } else {
4960 $ this ->error ('The path to the jsons folder is not valid ' );
5061 }
You can’t perform that action at this time.
0 commit comments