Skip to content

Commit 4980d24

Browse files
committed
Upgraded self-update package
1 parent 582528e commit 4980d24

File tree

2 files changed

+26
-15
lines changed

2 files changed

+26
-15
lines changed

app/Commands/SelfUpdateCommand.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
namespace App\Commands;
44

5+
use HnhDigital\LaravelConsoleSelfUpdate\SelfUpdateInterface;
56
use HnhDigital\LaravelConsoleSelfUpdate\SelfUpdateTrait;
67
use LaravelZero\Framework\Commands\Command;
78

8-
class SelfUpdateCommand extends Command
9+
class SelfUpdateCommand extends Command implements SelfUpdateInterface
910
{
1011
use SelfUpdateTrait;
1112

@@ -32,12 +33,16 @@ class SelfUpdateCommand extends Command
3233
*/
3334
public function handle()
3435
{
35-
$this->parseVersion();
36+
$this->setVersionsTagKey('path');
37+
$this->setHashSource(SelfUpdateInterface::CHECKSUM_TOP_LEVEL);
38+
$this->setHashPath('checksum');
39+
40+
list($release, $tag) = $this->parseVersion(config('app.version'));
3641

3742
$url = config('app.update-url');
3843

39-
if ($this->release !== 'stable' && $this->release !== 'RELEASE') {
40-
$url .= '/'.$this->release;
44+
if ($release !== 'stable' && $release !== 'RELEASE') {
45+
$url .= '/'.$release;
4146
}
4247

4348
$this->setUrl($url);

composer.lock

Lines changed: 17 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)