[英]In JetBrains IDEs (e.g. CLion, IntelliJ), external tools cannot use globbing patterns
I added an external tool to CLion with the following details: 我向CLion添加了一个外部工具,其详细信息如下:
Program: zip
Parameters: asm.zip *.cc *.h
Working directory: $ProjectFileDir$
When I run this external tool as part of my build command, it says: 当我在构建命令中运行此外部工具时,它说:
zip asm.zip *.cc *.h
zip warning: name not matched: *.cc
zip warning: name not matched: *.h
zip error: Nothing to do! (asm.zip)
Process finished with exit code 12
But when I replace the details with: 但是当我将细节替换为:
Program: ls
Parameters:
Working directory: $ProjectFileDir$
Then the output is the list of files in the project folder (which includes .cc and .h files) and the build completes successfully. 然后,输出为项目文件夹中的文件列表(包括.cc和.h文件),并且构建成功完成。 What am I doing wrong? 我究竟做错了什么?
Clion invokes the command you run directly, without expanding globs ( *
character). Clion会调用您直接运行的命令,而不会扩展glob( *
字符)。
Modify the settings to, eg.: 将设置修改为例如:
Program: sh
Parameters: -c "zip asm.zip *.cc *.h"
This way, the sh
shell will correctly expand the arguments. 这样, sh
shell将正确扩展参数。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.