windowsgruntjsnetwork-drivegrunt-contrib-copy

Grunt Copy from Windows C Drive to Mapped Network Drive


Background

I have a local set of files on my computer, under C:/websites/PROJECT. I would like to use Grunt to copy these files to a live server when I'm ready to push changes. I have access to the live server, which is self hosted. I can access it several ways. (Names and IP addresses changed for privacy concerns)

First off, it's a Mapped Network Drive, so accessible under:

K:\

Second, I can access it under the Network portion of Windows Explorer, through it's computer name.

\\SERVER1-NAME\PROJECT

Third, I know the internal IP of the computer:

\\192.168.1.1\PROJECT

Grunt Code:

copy: {
    options: {
        force: true
    },
    files: {
        expand: true,
        cwd: 'C:/websites/PROJECT/src',  // set working folder / root to copy
        src: [
            '**/*'
        ],
        dest: '//192.168.1.1/PROJECT' // destination folder
    }
},

I have tried all of these for dest:

'//K:/PROJECT'
'//SERVER1/PROJECT'
'//192.168.1.1/PROJECT'

'\\\\K:\\PROJECT'
'\\\\SERVER1\\PROJECT'
'\\\\192.168.1.1\\PROJECT'

All of them give me errors. Most of the time, they also end up creating an empty folder on the C drive as well. Example: C:/192.168.1.1.

I found this: Grunt JS copy to network location

But when I tried it, it doesn't work. Any help would be appreciated.


Solution

  • Answer

    It appears that this just doesn't work.

    Followup

    As an alternative, I just set up SFTP access, and used grunt-sftp-deploy