pull/3608/head
Alper Ebicoglu 6 years ago
parent 259c1041cd
commit 09d832753f

@ -3,19 +3,27 @@
public static class CliUrls
{
#if DEBUG
public const string WwwAbpIo = "https://localhost:44328/";
public const string WwwAbpIo = WwwAbpIoDevelopment;
public const string AccountAbpIo = "https://localhost:44333/";
public const string AccountAbpIo = AccountAbpIoDevelopment;
public const string NuGetRootPath = "https://localhost:44373/";
public const string NuGetRootPath = NuGetRootPathDevelopment;
#else
public const string WwwAbpIo = "https://abp.io/";
public const string WwwAbpIo = WwwAbpIoProduction;
public const string AccountAbpIo = "https://account.abp.io/";
public const string AccountAbpIo = AccountAbpIoProduction;
public const string NuGetRootPath = "https://nuget.abp.io/";
public const string NuGetRootPath = NuGetRootPathProduction;
#endif
public const string WwwAbpIoProduction = "https://abp.io/";
public const string AccountAbpIoProduction = "https://account.abp.io/";
public const string NuGetRootPathProduction = "https://nuget.abp.io/";
public const string WwwAbpIoDevelopment = "https://localhost:44328/";
public const string AccountAbpIoDevelopment = "https://localhost:44333/";
public const string NuGetRootPathDevelopment = "https://localhost:44373/";
public static string GetNuGetServiceIndexUrl(string apiKey)
{
return $"{NuGetRootPath}{apiKey}/v3/index.json";

@ -58,7 +58,7 @@ namespace Volo.Abp.Cli.ProjectBuilding
string latestVersion;
#if DEBUG
latestVersion = GetCurrentVersionFromAssembly();
latestVersion = await GetLatestSourceCodeVersionAsync(name, type, $"{CliUrls.WwwAbpIoProduction}api/download/{type}/get-version/");
#else
latestVersion = await GetLatestSourceCodeVersionAsync(name, type);
#endif
@ -133,16 +133,12 @@ namespace Volo.Abp.Cli.ProjectBuilding
return new TemplateFile(fileContent, version, latestVersion, nugetVersion);
}
private static string GetCurrentVersionFromAssembly()
private async Task<string> GetLatestSourceCodeVersionAsync(string name, string type, string url)
{
var assembly = Assembly.GetExecutingAssembly();
var fullVersion = assembly.GetName().Version.ToString(); //eg: 2.6.0.0
return fullVersion.Substring(0, fullVersion.LastIndexOf('.')); //eg: 2.6.0
}
private async Task<string> GetLatestSourceCodeVersionAsync(string name, string type)
{
var url = $"{CliUrls.WwwAbpIo}api/download/{type}/get-version/";
if (url == null)
{
url = $"{CliUrls.WwwAbpIo}api/download/{type}/get-version/";
}
try
{

Loading…
Cancel
Save