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

Uses 'PAKET.VERSION' environment variable for bootstrap requests #771

Merged
merged 3 commits into from
Apr 13, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/content/bootstrapper.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ Options:
`version`: Downloads the given version of paket.exe from github.com.

`--prefer-nuget`: Downloads the given version of paket.exe from nuget.org instead of github.com.

Environment Variables:

`PAKET.VERSION`: The requested version can also be set using this environment variable. Above options take precedence over the environment variable
6 changes: 5 additions & 1 deletion src/Paket.Bootstrapper/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class Program
{
const string PreferNugetCommandArg = "--prefer-nuget";
const string PrereleaseCommandArg = "prerelease";
const string PaketVersionEnv = "PAKET.VERSION";

static IWebProxy GetDefaultWebProxyFor(String url)
{
Expand Down Expand Up @@ -136,14 +137,15 @@ private static DownloadArguments EvaluateCommandArgs(string[] args)
var folder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
var target = Path.Combine(folder, "paket.exe");

var latestVersion = "";
var latestVersion = Environment.GetEnvironmentVariable(PaketVersionEnv) ?? "";
var ignorePrerelease = true;

if (args.Length >= 1)
{
if (args[0] == PrereleaseCommandArg)
{
ignorePrerelease = false;
latestVersion = "";
Console.WriteLine("Prerelease requested. Looking for latest prerelease.");
}
else
Expand All @@ -152,6 +154,8 @@ private static DownloadArguments EvaluateCommandArgs(string[] args)
Console.WriteLine("Version {0} requested.", latestVersion);
}
}
else if (!String.IsNullOrWhiteSpace(latestVersion))
Console.WriteLine("Version {0} requested.", latestVersion);
else Console.WriteLine("No version specified. Downloading latest stable.");


Expand Down