Sergej Popov
Sergej Popov

Reputation: 3021

Grunt JS copy to network location

I want to use grunt-contrib-copy (or any other grunt copying plugin) to copy files to network location.

Trying below:

    copy: {
        test: {
            files: [
                { src: ['Scripts/*'], dest: ['\\\\location\\site\\Scripts\'] }
            ]
        }
    }

but getting:

Warning: Unable to write "\\location\site\Scripts\" file (Err or code: undefined). Use --force to continue.

Is it possible / How to copy to network location?

Upvotes: 12

Views: 2910

Answers (2)

Jowa
Jowa

Reputation: 51

to copy files from mac to windows shared directory prepend the destination with smb:

copy: {
  test: {
    files: [
      { src: ['Scripts/*'], dest: ['smb://location/site/Scripts/'] }
    ]
  }
}

kr, Joachim

Upvotes: -1

Allan Kimmer Jensen
Allan Kimmer Jensen

Reputation: 4389

Yes, it's quite simple to do, just define your path with forward slashes:

copy: {
     test: {
         files: [
             { src: ['Scripts/*'], dest: ['//location/site/Scripts/'] }
         ]
     }
}

This will work on windows as-well, grunt will take care of that. Try it out.

Upvotes: 12

Related Questions