grunt-sftp-deploy icon indicating copy to clipboard operation
grunt-sftp-deploy copied to clipboard

path in file names

Open atbjk opened this issue 10 years ago • 5 comments

I still have this issue. Folders transfer fine, but the files have the path name in them. Server sep is not working for me. Below is the code i use: 'sftp-deploy': { build: { auth: { host: 'joseph.site.devel', port: 22, authKey: 'key1' }, src: 'public', // cache: 'sftpCache.json', dest: '/home/httpd/vhosts/site.com/httpdocs/public', // exclusions: ['public//.DS_Store', 'public//Thumbs.db'], serverSep: '/', concurrency: 8, progress: true

}

atbjk avatar Jul 23 '14 06:07 atbjk

I guess you're working on Windows.

This issue can be solved by changing toFile = remoteRoot + remoteSep + inFilename; to toFile = remoteRoot + remoteSep + inFilename.replace(path.sep, remoteSep); in sftpPut(inFilename, cb).

sanojb avatar Jul 29 '14 16:07 sanojb

I had this issue too. The above code is almost a fix, but not quite since it only replaces the first separator in the path. Have created a pull request courtesy of sanojb's pointer above with a fix here: https://github.com/thrashr888/grunt-sftp-deploy/pull/50

rbalmf avatar Aug 04 '14 10:08 rbalmf

I can confirm this issue.

kallaspriit avatar Nov 20 '14 13:11 kallaspriit

Apparently it has been fixed but the configuration used to use a parameter called "server_sep" which has now been changed to "serverSep" so my value had no effect. Perhaps the old parameter should still work for those updating the library and show deprecated warning.

kallaspriit avatar Nov 20 '14 14:11 kallaspriit

Pull request https://github.com/thrashr888/grunt-sftp-deploy/pull/77 might fix this. I'm using git-bash under windows and sftp-deploy get's confused with the path separators. With the fix you can set the option "localSep" according to "serverSep".

barigorokarl avatar Oct 28 '15 21:10 barigorokarl