grunt-sftp-deploy
grunt-sftp-deploy copied to clipboard
path in file names
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
}
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).
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
I can confirm this issue.
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.
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".