在JetBrains IDE(例如CLion,IntelliJ)中,外部工具不能使用通配模式 [英] In JetBrains IDEs (e.g. CLion, IntelliJ), external tools cannot use globbing patterns

查看:246
本文介绍了在JetBrains IDE(例如CLion,IntelliJ)中,外部工具不能使用通配模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我向CLion添加了一个外部工具,其中包含以下详细信息:

I added an external tool to CLion with the following details:

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$

然后输出是项目文件夹中的文件列表(包括.cc和.h文件)并且构建成功完成。我做错了什么?

Then the output is the list of files in the project folder (which includes .cc and .h files) and the build completes successfully. What am I doing wrong?

推荐答案

Clion调用你直接运行的命令,而不扩展globs( * 字符)。

Clion invokes the command you run directly, without expanding globs (* character).

将设置修改为,例如:

Program: sh
Parameters: -c "zip asm.zip *.cc *.h"

这样, sh shell将正确扩展参数。

This way, the sh shell will correctly expand the arguments.

这篇关于在JetBrains IDE(例如CLion,IntelliJ)中,外部工具不能使用通配模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆