Skip to content

Commit

Permalink
update some for git usage
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Sep 22, 2020
1 parent 753058d commit cd08e6e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
9 changes: 6 additions & 3 deletions app/Console/Controller/GitLabController.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ public function configCommand(Input $input, Output $output): void
* @options
* -m, --message The commit message
*
* @arguments
* files... Only add special files
*
* @param Input $input
* @param Output $output
*
Expand Down Expand Up @@ -270,10 +273,10 @@ public function openCommand(Input $input, Output $output): void
}

$remote = $input->getArg('remote', $defRemote);
$rInfo = $gitlab->parseRemote($remote)->getRemoteInfo();
// \var_dump($defRemote, $gitlab);die;

$gitlab->parseRemote($remote);

$link = $gitlab->getRepoUrl($toMain);
$link = $gitlab->getHost() . '/' . $rInfo['path'];
AppHelper::openBrowser($link);

$output->success('Complete');
Expand Down
10 changes: 9 additions & 1 deletion app/Console/Controller/GitUseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,9 @@ public function acCommand(Input $input, Output $output): void
* @options
* -m, --message The commit message
*
* @arguments
* files... Only add special files
*
* @param Input $input
* @param Output $output
*/
Expand All @@ -300,7 +303,12 @@ public function acpCommand(Input $input, Output $output): void

$output->info('Work Dir: ' . $input->getPwd());

$run = CmdRunner::new('git add .')->do(true);
$added = '.';
if ($args = $input->getArguments()) {
$added = implode(' ', $args);
}

$run = CmdRunner::new("git add $added")->do(true);
$run->afterOkDo(sprintf('git commit -m "%s"', $message));
$run->afterOkDo('git push');

Expand Down

0 comments on commit cd08e6e

Please sign in to comment.