指定したファイルを各ディレクトリに再帰的にコピーするタスクを構成して実行したいと思います。具体的には、Web プロジェクトの各ディレクトリとサブディレクトリに "index.php" をコピーしたいと考えています (存在しない場合)。を使用しようとしましたが、ワイルドカードを使用multidest
してパスを指定できないようです (残念です!)。どうすればこれを解決できますか?ありがとうございましたcopy
multidest
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
multidest: {
tst: {
tasks: ['copy:indexphp'],
dest: '**/' //THIS DOESN'T WORK, I SHOULD SPECIFY ANY DIR/SUBDIR/ETC..
},
},
copy: {
indexphp: {
expand: true,
cwd: 'classes',
src: 'index.php',
filter: function (filepath) {
// NPM load file path module.
var path = require('path');
// Construct the destination file path.
var dest = path.join(
grunt.task.current.data.dest,
path.basename(filepath)
);
// Return false if the file exists.
return !(grunt.file.exists(dest));
}
},
[...]