-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stop self-update picking releases that are not the latest #153
Conversation
b4f80c8
to
63a45de
Compare
We will be using pre-release tags for testing, which would be listed later than the latest tag
63a45de
to
519899c
Compare
} | ||
|
||
$latest = $releases[0]; | ||
$latest = json_decode($release); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not related to this PR, but no error handling here? (e.g. wrong URL, invalid JSON)
} else { | ||
unlink($file); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI I introduced a Workspace
class which does this sort of thing for tests (and isn't confusing in this project):
// abstract test class in test directory
public function workspace(): Workspace
{
$workspace = new Workspace(__DIR__ . '/Workspace');
}
// setup
$this->workspace()->reset();
// test
$this->workspace()->...
if (!file_exists($dir)) { | ||
mkdir($dir); | ||
} | ||
$contents = file_get_contents(__DIR__ . '/fixtures/tpl/latest.json'); | ||
$contents = str_replace(['%%browserDownloadUrl%%', '%%versionTag%%'], [$releasePath, $version], $contents); | ||
|
||
file_put_contents(__DIR__ . '/fixtures/generated/' . $name, $contents); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if using Workspace
this becomes $workspace->put('fixtures/generated..
etc (it should take care of reating parent dirs etc)
We will be using pre-release tags for testing, which would be listed later than the latest tag