1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-06 00:40:06 +01:00

extract logic

This commit is contained in:
Taylor Otwell
2016-05-11 15:29:04 -05:00
parent ba73074f77
commit d98fce6f08
2 changed files with 14 additions and 3 deletions

View File

@@ -220,9 +220,7 @@
* Determine if this is the latest release of Valet.
*/
$app->command('on-latest-version', function () use ($version) {
$response = Httpful\Request::get('https://api.github.com/repos/laravel/valet/releases/latest')->send();
if (version_compare($version, trim($response->body->tag_name, 'v'), '>=')) {
if (Valet::onLatestVersion($version)) {
output('YES');
} else {
output('NO');