Skip to content

Commit

Permalink
Merge branch 'master' of github.com:freescout-helpdesk/freescout into…
Browse files Browse the repository at this point in the history
… dist
  • Loading branch information
freescout-help-desk committed Nov 16, 2018
2 parents fa902b3 + b53cfe4 commit c62a87a
Showing 1 changed file with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ public function isNewVersionAvailable($currentVersion = '')
}

if (version_compare($version, $this->getVersionAvailable(), '<')) {
if (!$this->versionFileExists()) {
$this->setVersionFile($this->getVersionAvailable());
event(new UpdateAvailable($this->getVersionAvailable()));
}
// if (!$this->versionFileExists()) {
// $this->setVersionFile($this->getVersionAvailable());
// event(new UpdateAvailable($this->getVersionAvailable()));
// }

return true;
}
Expand Down Expand Up @@ -229,13 +229,14 @@ public function getVersionInstalled($prepend = '', $append = '')
*/
public function getVersionAvailable($prepend = '', $append = '')
{
if ($this->versionFileExists()) {
$version = $prepend.$this->getVersionFile().$append;
} else {
$response = $this->getRepositoryReleases();
$releaseCollection = collect(\GuzzleHttp\json_decode($response->getBody()));
$version = $prepend.$releaseCollection->first()->name.$append;
}
// No need to save version to file.
// if ($this->versionFileExists()) {
// $version = $prepend.$this->getVersionFile().$append;
// } else {
$response = $this->getRepositoryReleases();
$releaseCollection = collect(\GuzzleHttp\json_decode($response->getBody()));
$version = $prepend.$releaseCollection->first()->name.$append;
//}

return $version;
}
Expand Down

0 comments on commit c62a87a

Please sign in to comment.