@ -48,13 +47,13 @@ public class InstallLibsService : IInstallLibsService, ITransientDependency
return;
}
if(!IsNpmInstalled())
if(!NpmHelper.IsNpmInstalled())
{
Logger.LogWarning("NPM is not installed, visit https://nodejs.org/en/download/ and install NPM");
return;
}
if(!IsYarnAvailable())
if(!NpmHelper.IsYarnAvailable())
{
Logger.LogWarning("YARN is not installed, which may cause package inconsistency, please use YARN instead of NPM. visit https://classic.yarnpkg.com/lang/en/docs/install/ and install YARN");
}
@ -72,13 +71,13 @@ public class InstallLibsService : IInstallLibsService, ITransientDependency
// angular
if(projectPath.EndsWith("angular.json"))
{
if(IsYarnAvailable())
if(NpmHelper.IsYarnAvailable())
{
RunYarn(projectDirectory);
NpmHelper.RunYarn(projectDirectory);
}
else
{
RunNpmInstall(projectDirectory);
NpmHelper.RunNpmInstall(projectDirectory);
}
}
@ -92,13 +91,13 @@ public class InstallLibsService : IInstallLibsService, ITransientDependency
continue;
}
if(IsYarnAvailable())
if(NpmHelper.IsYarnAvailable())
{
RunYarn(projectDirectory);
NpmHelper.RunYarn(projectDirectory);
}
else
{
RunNpmInstall(projectDirectory);
NpmHelper.RunNpmInstall(projectDirectory);
}
awaitCleanAndCopyResources(projectDirectory);
@ -244,31 +243,4 @@ public class InstallLibsService : IInstallLibsService, ITransientDependency
returnpattern;
}
privatevoidRunNpmInstall(stringdirectory)
{
Logger.LogInformation($"Running npm install on {directory}");
CmdHelper.RunCmd($"npm install",directory);
}
privatevoidRunYarn(stringdirectory)
{
Logger.LogInformation($"Running Yarn on {directory}");