Browse Source

CLI: Add .npmrc file before searching for the nightly packages

pull/17620/head
Engincan VESKE 3 years ago
parent
commit
6d05d57b4d
  1. 21
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/NpmPackagesUpdater.cs

21
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/NpmPackagesUpdater.cs

@ -64,6 +64,18 @@ public class NpmPackagesUpdater : ITransientDependency
_npmGlobalPackagesChecker.Check(); _npmGlobalPackagesChecker.Check();
foreach (var file in fileList)
{
if (includePreviews)
{
await CreateNpmrcFileAsync(Path.GetDirectoryName(file));
}
else if (switchToStable)
{
await DeleteNpmrcFileAsync(Path.GetDirectoryName(file));
}
}
var packagesUpdated = new ConcurrentDictionary<string, bool>(); var packagesUpdated = new ConcurrentDictionary<string, bool>();
async Task UpdateAsync(string file) async Task UpdateAsync(string file)
@ -80,15 +92,6 @@ public class NpmPackagesUpdater : ITransientDependency
{ {
var fileDirectory = Path.GetDirectoryName(file.Key).EnsureEndsWith(Path.DirectorySeparatorChar); var fileDirectory = Path.GetDirectoryName(file.Key).EnsureEndsWith(Path.DirectorySeparatorChar);
if (includePreviews)
{
await CreateNpmrcFileAsync(Path.GetDirectoryName(file.Key));
}
else if (switchToStable)
{
await DeleteNpmrcFileAsync(Path.GetDirectoryName(file.Key));
}
if (await NpmrcFileExistAsync(fileDirectory)) if (await NpmrcFileExistAsync(fileDirectory))
{ {
RunNpmInstall(fileDirectory); RunNpmInstall(fileDirectory);

Loading…
Cancel
Save