CCNet - 预构建任务 cmd.exe?
在进行全新构建之前,我在 ccnet.config 文件中使用命令行预构建任务来删除工作目录的内容。
<prebuild>
<exec>
<executable>%SYSTEM32%\cmd.exe</executable>
<buildArgs>/c "if exist "C:\CruiseControl\Working" rd /s /q "C:\CruiseControl\Working""</buildArgs>
</exec>
</prebuild>
问题是我收到错误:
System.IO.IOException:无法执行文件 [C:\CruiseControl\Working\cmd.exe]。
它似乎正在工作文件夹中寻找 cmd.exe。 所以我尝试添加 cmd.exe 的路径,如下所示:
<prebuild>
<exec>
<executable>%SYSTEM32%\cmd.exe</executable>
<buildArgs>/c "if exist "C:\CruiseControl\Working" rd /s /q "C:\CruiseControl\Working""</buildArgs>
</exec>
</prebuild>
任何帮助都会很棒吗?
Im using a command line prebuild task in the ccnet.config file to delete the contents of thw working directory before i do a clean build.
<prebuild>
<exec>
<executable>%SYSTEM32%\cmd.exe</executable>
<buildArgs>/c "if exist "C:\CruiseControl\Working" rd /s /q "C:\CruiseControl\Working""</buildArgs>
</exec>
</prebuild>
The problem is I get an error:
System.IO.IOException: Unable to execute file [C:\CruiseControl\Working\cmd.exe].
it seems to be looking for cmd.exe in the working folder.
So I tried adding the path to cmd.exe instead as follows:
<prebuild>
<exec>
<executable>%SYSTEM32%\cmd.exe</executable>
<buildArgs>/c "if exist "C:\CruiseControl\Working" rd /s /q "C:\CruiseControl\Working""</buildArgs>
</exec>
</prebuild>
Any help would be great?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我找到了最初问题的答案:
我只需将 cleanCopy true 放入源代码控制块中即可。
I have found the answer to my original question:
I simply had to put the cleanCopy true inside the sourcecontrol block.
cmd.exe 所在的路径位于您的 %PATH% 环境变量中。不需要显式设置(在执行提示符下输入
cmd
即可验证):至于目录使用问题。我认为您希望删除 C:\CruiseControl\Working 的子目录而不是整个working。也可能是 svn 或其他进程正在处理它。 运行会发生什么?
如果直接在cmd中
The path where is located cmd.exe is in your %PATH% Environment variable. You don't need to explicitely set it (you can verify it by typing
cmd
in the execute prompt) :As for the directory use problem. I think you wish to delete a subdirectory of C:\CruiseControl\Working instead of the whole Working. It could also be that svn or another process is working on it. What happens if you run
directly in cmd?
我在块中的 cmd.exe 遇到同样的问题。我在 Source Gear Vault 的多源控制块中将
cleanCopy
设置为 true。除了将我的单行命令放入 .cmd 文件中之外,这里或其他任何地方都没有解决这个问题,但我宁愿不必为我需要从命令提示符运行的每一小行创建一个 .cmd。I have the same problem with cmd.exe in a block. I have
cleanCopy
set to true in a multi source control block with Source Gear Vault. Nothing here or anywhere else has solved this problem other than putting my single line command into a .cmd file, but I would rather not have to create a .cmd for every little line I need to run from the command prompt.