Using latest version of grunt if we try to work like copying
copy: {
main: {
files: [
{ expand: true
src: ['/dev/war archive/latestfile/**/*.txt'],
dest: '/fernando/backups/pbuse/war',
filter :'isFile'
}
]
}
}
This will result in Error: Unable to create directory "C:\harikishore\backups\war\C:" (Error code: ENOENT)
In latest version of grunt we need to add the cwd(currentworkingdirectory) where the provided src is located for the action otherwise grunt-action will consider the actual system path included with src,so while creating destination will try to create the systempath which will result in the above error so it will work if change the code as below:
main: {
}
So,now it will start the dest folder creation from src instead of system path included
Alternative: adding
flaten:trueproperty This will allow us to pass the action since we are not creating the inner folder structure of src in dest just copying all the files and dumping in single outer folder.If we need inner folder structure of src in dest also then we must need cwd