简体   繁体   中英

In JetBrains IDEs (e.g. CLion, IntelliJ), external tools cannot use globbing patterns

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$

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 invokes the command you run directly, without expanding globs ( * character).

Modify the settings to, eg.:

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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