I want grunt to copy the file to the network path.

Допустим Сетевой путь: dest: '\\mywww\dev\site\view\text.js' Но вместо этого он создаёт папку C:/mywww\dev\site\view 

It doesn't work everywhere: grunt-contrib-concat grunt-contrib-uglify works well

and here is grunt-contrib-copy

Writes:

Warning: Unable to create directory "C: \ inetpub \ wwwroot \ rrr \ C:" (Error code: ENOENT). Use --force to continue.

despite the fact that it creates a directory if it does not exist. C: \ inetpub \ wwwroot \ rrr

setting:

 copy: { default: { expand: true, src: ['C:/inetpub/wwwroot/** '], dest: 'C:/inetpub/wwwroot/rrr', }, }, 
  • 2
    Try to put forward slashes: dest: '//mywww/dev/site/view/text.js' - kmv
  • updated the question. - manking

1 answer 1

Try to put forward slashes: dest: '//mywww/dev/site/view/text.js'


On the second part of the question: copying the absolute path in src almost always does not work as it should. It is necessary to set the cwd parameter, and in src specify the path relative to the path in cwd :

 copy: { default: { expand: true, cwd: 'C:/inetpub/wwwroot', src: ['./**'], dest: 'C:/inetpub/wwwroot/rrr', }, }, 

PS Copying goes to the subdirectory of the source directory, so each time you start grunt, you will create all new and new files. Exclude destination files from source: src: ['./**', '!./rrr/**'] .