如何使用Cake脚本清除本地nuget包缓存
问题描述:
我需要清除缓存在系统中的NuGet。如何使用Cake脚本清除本地nuget包缓存
我可以在我的命令提示符下运行以下命令。
nuget locals -clear all
如何使用Cake脚本来做同样的事情。
请建议可能的方法。
答
有在蛋糕的NuGet命令没有用的包装,但你可以很容易,只需启动,作为一个过程,从蛋糕这样
int nugteClear = StartProcess("nuget", "locals -clear all");
if (nugteClear != 0)
{
throw new Exception("Failed to clear package cache.");
}