简体   繁体   中英

Grunt copy / ant pattern / omit variable directory

I need copy files from folder src/plugin@xxx to dist/plugin.

Version can be changed so I want to omit version number everywhere. I do:

files[{
    cwd: 'src'
    src: 'plugin@*/**/*'
    dest: 'dist/plugin'
}];

But it copy my files to dist/plugin/plugin@xxx directory.

I want my files in dist/plugin directory (without specify xxx in grunt task).

You want the flatten option. I think you also need expand for flatten to work:

files: [ {
    cwd: 'src'
    src: 'plugin@*/**/*'
    dest: 'dist/plugin',
    expand: true,
    flatten: true
} ],

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