1

I need copy files from folder src/plugin@x.x.x 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@x.x.x directory.

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

OKey
  • 182
  • 1
  • 2
  • 10

1 Answers1

0

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
} ],
Jordan Running
  • 102,619
  • 17
  • 182
  • 182
  • Flatten option will destroy structure of plugin making it flat. I need to keep structure below plugin folder unchanged. – OKey Nov 22 '15 at 22:16
  • Does `src: 'plugin@*'` do what you want? – Jordan Running Nov 22 '15 at 22:17
  • No. I think only any function can handle my problem but I prefer gulp over grunt and I really don't know how can I process that. options.process function doen't seem to work. – OKey Nov 23 '15 at 07:47