Skip to content
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

Merged
merged 1 commit into from
Sep 22, 2023

Conversation

andytson-inviqa
Copy link
Contributor

We will be using pre-release tags for testing, which would be listed later than the latest tag

@andytson-inviqa andytson-inviqa force-pushed the feature/self-update-latest branch 4 times, most recently from b4f80c8 to 63a45de Compare February 24, 2023 14:50
We will be using pre-release tags for testing, which would be listed later than the latest tag
}

$latest = $releases[0];
$latest = json_decode($release);
Copy link
Collaborator

@dantleech dantleech Feb 24, 2023

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);
}
}
Copy link
Collaborator

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);
Copy link
Collaborator

@dantleech dantleech Feb 24, 2023

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)

@andytson-inviqa andytson-inviqa added this to the 0.4.0 milestone Sep 15, 2023
@andytson-inviqa andytson-inviqa merged commit ba0808f into 0.3.x Sep 22, 2023
@andytson-inviqa andytson-inviqa deleted the feature/self-update-latest branch September 22, 2023 13:41
@kierenevans kierenevans added the bug Something isn't working label Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants