mirror of
https://github.com/andres-montanez/Magallanes
synced 2024-06-20 14:35:05 +02:00
Merge pull request #171 from jhuet/fix/scm-working-directory
Fix/Scm working directory
This commit is contained in:
commit
3e07478338
|
@ -63,14 +63,15 @@ class ChangeBranchTask extends AbstractTask
|
|||
*/
|
||||
public function run()
|
||||
{
|
||||
$preCommand = 'cd ' . $this->getConfig()->deployment('from', './') . '; ';
|
||||
switch ($this->getConfig()->general('scm')) {
|
||||
case 'git':
|
||||
if ($this->getParameter('_changeBranchRevert', false)) {
|
||||
$command = 'git checkout ' . self::$startingBranch;
|
||||
$command = $preCommand . 'git checkout ' . self::$startingBranch;
|
||||
$result = $this->runCommandLocal($command);
|
||||
|
||||
} else {
|
||||
$command = 'git branch | grep \'*\' | cut -d\' \' -f 2';
|
||||
$command = $preCommand . 'git branch | grep \'*\' | cut -d\' \' -f 2';
|
||||
$currentBranch = 'master';
|
||||
$result = $this->runCommandLocal($command, $currentBranch);
|
||||
|
||||
|
|
|
@ -54,9 +54,10 @@ class UpdateTask extends AbstractTask
|
|||
*/
|
||||
public function run()
|
||||
{
|
||||
$command = 'cd ' . $this->getConfig()->deployment('from', './') . '; ';
|
||||
switch ($this->getConfig()->general('scm')) {
|
||||
case 'git':
|
||||
$command = 'git pull';
|
||||
$command .= 'git pull';
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
Loading…
Reference in a new issue