Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cwrsync not creating folders on server #33

Open
reggie3 opened this issue Jan 8, 2016 · 2 comments
Open

cwrsync not creating folders on server #33

reggie3 opened this issue Jan 8, 2016 · 2 comments

Comments

@reggie3
Copy link

reggie3 commented Jan 8, 2016

I've gotten the following gulp task to transfer files from a Windows 10 machine to a remote Linux server. However, files are being copied with a backslash "" vice forward slash "/" resulting in long file names like "js\myjs.js" instead of creating a folder called "js" with "myjs.js" in it. I haven't found an option or switch to fix the problem. Any ideas what I'm doing wrong?

gulp.task('deploy', function() {
return gulp.src('dist/*/')
.pipe(rsync({
options: {
chmod: 'ugo=rwX',
'r': true,
'v': true,
'delete': true,
'verbose': true,
'progress': true
},
username: "user",
password: "pass",
hostname: 'host.com',
destination: '~/test/',
recursive: true,
root: "dist/"
}));
});

@nevf
Copy link

nevf commented Feb 1, 2016

@reggie3 I've got the same problem and have battling with all day.

In gulp-rsync index.js change:

      source: sources.map(function(source) {
        return path.relative(cwd, source.path) || '.';
      }),

to:

      source: sources.map(function(source) {
        var file_path = (path.relative(cwd, source.path) || '.').replace( /\\/g, '/')
        // console.log( 'gulp-rsync source:', source.path, ', ret: ', file_path );
        return file_path
      }),

path.relative() is the culprit.

There may be a better solution and I'll continue looking at it tomorrow,

@nevf
Copy link

nevf commented Feb 2, 2016

@reggie3 The fork mentioned #28 resolves this issue. However the same dev has created rsync-slim https://github.com/stcruy/rsync-slim which I suggest folks use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants