Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
Add cli option for fetching latest github pre-release
Browse files Browse the repository at this point in the history
  • Loading branch information
caesay committed Feb 10, 2022
1 parent 1b48c4c commit f91c58c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/SquirrelCli/Options.cs
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,13 @@ internal class SyncGithubOptions : BaseOptions
{
public string repoUrl { get; private set; }
public string token { get; private set; }
public bool pre { get; private set; }

public SyncGithubOptions()
{
Add("repoUrl=", "Full url to the github repository\nexample: 'https://github.com/myname/myrepo'", v => repoUrl = v);
Add("token=", "OAuth token to use as login credentials", v => token = v);
Add("pre", "Fetch the latest pre-release instead of stable", v => pre = true);
}

public override void Validate()
Expand Down
2 changes: 1 addition & 1 deletion src/SquirrelCli/Sync/GitHubRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public async Task DownloadRecentPackages()
releaseDirectoryInfo.Create();

var releases = await GithubUpdateManager.GetGithubReleases(
new Uri(_options.repoUrl), _options.token, false, dl);
new Uri(_options.repoUrl), _options.token, _options.pre, dl);

if (!releases.Any()) {
Log.Warn("No github releases found.");
Expand Down

0 comments on commit f91c58c

Please sign in to comment.