Skip to content

Commit

Permalink
Do not save latest app version to file
Browse files Browse the repository at this point in the history
  • Loading branch information
freescout-help-desk committed Nov 16, 2018
1 parent e3e7d28 commit b53cfe4
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 b53cfe4

Please sign in to comment.