简体   繁体   English

使用Visual Studio在TFS中分支时执行npm install

[英]execute npm install, when branching in TFS with Visual Studio

Is there a way I can hook an npm install when I branch in Source Control explorer? 当我在Source Control Explorer中分支时,是否可以挂接npm install Or if I can access a powershell window to run a script to do that for me? 或者,如果我可以访问Powershell窗口来运行脚本来为我执行此操作?

No, there is no way to run npm install when you create branch. 不,创建分支时无法运行npm install。 If you have a large amount of projects need to run npm install after branch, you can create a powershell or batch script to do this just as you mentioned in your question. 如果您有大量项目需要在分支后运行npm install,则可以创建Powershell或批处理脚本来执行此操作,就像您在问题中提到的那样。

You can try do this through a custom Check-in policy . 您可以尝试通过自定义签入政策来执行此操作。 After branching in Source Control explorer, you need to check in the pending changes. 在“源代码管理”资源管理器中分支后,您需要签入挂起的更改。 These check-in policies require the user to take actions when they conduct a check-in to source control, for example a user can be required to associate a work item with a changeset. 这些签入策略要求用户在对源代码控制执行签入时采取措施,例如,可能要求用户将工作项与变更集相关联。

About how to create a custom check-in policy you can refer the detailed answer from jessehouwing in this TFS Client side hook . 关于如何创建自定义签入策略,您可以在此TFS客户端挂钩中引用jessehouwing的详细答案。 You can also take a look at this blog Creating TFS Custom Check-in Policy 您也可以在此博客中查看创建TFS自定义签入策略

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM