Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed May 28, 2020
1 parent 656385f commit 10fb34a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/Console/Group/GitGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,11 @@ public function ampCommand(Input $input, Output $output): void
}

$output->info('Work Dir: ' . $input->getPwd());
SysCmd::exec('git add .');
SysCmd::execAndPrintResult('git add .');

SysCmd::exec(sprintf('git commit -m "%s"', $message));
SysCmd::execAndPrintResult(sprintf('git commit -m "%s"', $message));

SysCmd::exec('git push');
SysCmd::execAndPrintResult('git push');

$output->info('Complete');
}
Expand Down
12 changes: 12 additions & 0 deletions app/Helper/SysCmd.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,16 @@ public static function exec(string $cmd, string $workDir = '', bool $coRun = fal
'output' => $output,
];
}

/**
* @param string $cmd
* @param string $workDir
* @param bool $coRun
*/
public static function execAndPrintResult(string $cmd, string $workDir = '', bool $coRun = false): void
{
$ret = self::exec($cmd, $workDir, $coRun);

echo $ret['output'];
}
}

0 comments on commit 10fb34a

Please sign in to comment.