From 1b2fd3f1e474ff072e7376ca6f7b230ea9812822 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Tue, 11 Jan 2022 14:03:56 +0300 Subject: [PATCH] Remove VoloRegistry from NpmrcFile --- .../ProjectModification/NpmPackagesUpdater.cs | 40 +------------------ 1 file changed, 1 insertion(+), 39 deletions(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/NpmPackagesUpdater.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/NpmPackagesUpdater.cs index 40478d109b..2ade6dbd77 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/NpmPackagesUpdater.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/NpmPackagesUpdater.cs @@ -121,7 +121,6 @@ public class NpmPackagesUpdater : ITransientDependency { var fileName = Path.Combine(directoryName, ".npmrc"); var abpRegistry = "@abp:registry=https://www.myget.org/F/abp-nightly/npm"; - var voloRegistry = await GetVoloRegistryAsync(); if (await NpmrcFileExistAsync(directoryName)) { @@ -132,11 +131,6 @@ public class NpmPackagesUpdater : ITransientDependency fileContent += Environment.NewLine + abpRegistry; } - if (!fileContent.Contains(voloRegistry)) - { - fileContent += Environment.NewLine + voloRegistry; - } - File.WriteAllText(fileName, fileContent); return; @@ -145,42 +139,10 @@ public class NpmPackagesUpdater : ITransientDependency using var fs = File.Create(fileName); var content = new UTF8Encoding(true) - .GetBytes(abpRegistry + Environment.NewLine + voloRegistry); + .GetBytes(abpRegistry); fs.Write(content, 0, content.Length); } - private async Task GetVoloRegistryAsync() - { - var apikey = await GetApiKeyAsync(); - - if (string.IsNullOrWhiteSpace(apikey)) - { - return ""; - } - - return "@volo:registry=https://www.myget.org/F/abp-commercial/auth/" + apikey + "/npm/"; - } - - public async Task GetApiKeyAsync() - { - try - { - var client = _cliHttpClientFactory.CreateClient(); - using (var response = await client.GetHttpResponseMessageWithRetryAsync( - url: $"{CliUrls.WwwAbpIo}api/myget/apikey/", - cancellationToken: CancellationTokenProvider.Token, - logger: Logger - )) - { - return Encoding.Default.GetString(await response.Content.ReadAsByteArrayAsync()); - } - } - catch (Exception) - { - return string.Empty; - } - } - private static bool IsAngularProject(string fileDirectory) { return File.Exists(Path.Combine(fileDirectory, "angular.json"));