Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
salahhusa9 committed Oct 22, 2023
1 parent 28f6b09 commit 84a2828
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/Pipelines/GitPipe.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Salahhusa9\Updater\Pipelines;

use Closure;
use Salahhusa9\Updater\Facades\Updater;
use Salahhusa9\Updater\Helpers\Git;

class GitPipe
Expand All @@ -14,7 +15,11 @@ public function handle($content, Closure $next)
Git::auth();
Git::fetch();
Git::pull();
Git::checkout($version);
$checkout = Git::checkout($version);

if (Updater::getCurrentVersion() != $version) {
return throw new \Exception('git checkout failed: '.$checkout);
}

return $next($content);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ function ($content) {
Artisan::call('up');
}

return $th->getMessage();
return throw $th;
}
} else {
return 'No new version available';
Expand Down

0 comments on commit 84a2828

Please sign in to comment.