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

directory separators on windows #2

Closed
valan opened this issue May 2, 2014 · 6 comments
Closed

directory separators on windows #2

valan opened this issue May 2, 2014 · 6 comments

Comments

@valan
Copy link
Contributor

valan commented May 2, 2014

I think this might be a directory separator thing.

in gulpfile:

gulp.task('deploy-sftp', function() {
    return gulp.src('./deploy.zip')
        .pipe(sftp({
            host: "XXXXXX",
            remotePath: "/var/www/html",
            auth: 'stage'
        }));
});

in .ftppass:

{
    "stage": {
        "user": "ec2-user",
        "key": "C:/Dropbox/.ssh/id_rsa"
    }
}

result on server:
new file in /home/ec2-user with the filename: "\var\www\html\deploy.zip" (backslashes are part of the filename) 0 bytes

@gtg092x
Copy link
Owner

gtg092x commented May 2, 2014

Will look into it, I don't have a windows machine. So a pull request would
speed this up.

Sent with AquaMail for Android
http://www.aqua-mail.com

On May 2, 2014 4:07:23 PM valan notifications@github.com wrote:

I think this might be a directory separator thing.

in gulpfile:

gulp.task('deploy-sftp', function() {
    return gulp.src('./deploy.zip')
        .pipe(sftp({
            host: "XXXXXX",
            remotePath: "/var/www/html",
            auth: 'stage'
        }));
});

in .ftppass:

{
    "stage": {
        "user": "ec2-user",
        "key": "C:/Dropbox/.ssh/id_rsa"
    }
}

result on server:
new file in /home/ec2-user with the filename: "\var\www\html\deploy.zip"
(backslashes are part of the filename) 0 bytes


Reply to this email directly or view it on GitHub:
#2

@gtg092x
Copy link
Owner

gtg092x commented May 23, 2014

Wanted to ping this for regression reasons. I made some major directory management changes, if any issues pop up with directories on Windows, feel free to reopen this issue. I will not have a windows machine in my possession until next month.

@valan
Copy link
Contributor Author

valan commented May 23, 2014

yeah I'm running into some issues with 0.0.11 now

here's my sftp block:

gulp.task('deploy-sftp', ['deploy-zip'], function() {
    var config = JSON.parse(fs.readFileSync('./.ftppass').toString());
    return gulp.src('./node_modules/deploy.zip')
        .pipe(sftp({
            host: config.stage.host,
            remotePath: config.stage.uploadPath,
            auth: 'stage'
        }));
});

I just put the zip file into node_modules because it's already ignored on my dropbox and I don't want it to start uploading via dropbox while I'm trying to upload via gulp

upload path is set to "/home/ec2-user" and that's where it would put deploy.zip in 0.0.6

here's what I get now:

[gulp] SFTP error or directory exists: Error: No such file home/ec2-user/node_modules

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: No such file
    at SFTP._parse (C:\Dropbox\work\protobox\web\cookpanion\node_modules\gulp-sftp\node_modules\ssh2\lib\SFTP\SFTPv3.js:986:23)
    at ChannelStream.<anonymous> (C:\Dropbox\work\protobox\web\cookpanion\node_modules\gulp-sftp\node_modules\ssh2\lib\SFTP\SFTPv3.js:49:12)
    at ChannelStream.EventEmitter.emit [as _emit] (events.js:95:17)
    at ChannelStream.emit (C:\Dropbox\work\protobox\web\cookpanion\node_modules\gulp-sftp\node_modules\ssh2\lib\Channel.js:613:12)
    at Parser.<anonymous> (C:\Dropbox\work\protobox\web\cookpanion\node_modules\gulp-sftp\node_modules\ssh2\lib\Channel.js:95:20)
    at Parser.EventEmitter.emit (events.js:95:17)
    at Parser.parsePacket (C:\Dropbox\work\protobox\web\cookpanion\node_modules\gulp-sftp\node_modules\ssh2\lib\Parser.js:596:12)
    at Parser.execute (C:\Dropbox\work\protobox\web\cookpanion\node_modules\gulp-sftp\node_modules\ssh2\lib\Parser.js:249:14)
    at Socket.<anonymous> (C:\Dropbox\work\protobox\web\cookpanion\node_modules\gulp-sftp\node_modules\ssh2\lib\Connection.js:515:18)
    at Socket.EventEmitter.emit (events.js:95:17)

I tried adding {base: "./node_modules"} to the source file stream, didn't have an effect

when I tried saving and uploading the zip in root instead of node_modules, I got a 0 byte file in the right place on the server, and gulp hangs on

[gulp] SFTP :: SFTP session closed

@gtg092x
Copy link
Owner

gtg092x commented May 23, 2014

Thanks for your patience here, I'll probably need your help addressing
this. I'll see if there's any gotchyas staring me in the face.

Sent with AquaMail for Android
http://www.aqua-mail.com

On May 23, 2014 1:08:19 PM valan notifications@github.com wrote:

yeah I'm running into some issues with 0.0.11 now

here's my sftp block:

gulp.task('deploy-sftp', ['deploy-zip'], function() {
    var config = JSON.parse(fs.readFileSync('./.ftppass').toString());
    return gulp.src('./node_modules/deploy.zip')
        .pipe(sftp({
            host: config.stage.host,
            remotePath: config.stage.uploadPath,
            auth: 'stage'
        }));
});

I just put the zip file into node_modules because it's already ignored on
my dropbox and I don't want it to start uploading via dropbox while I'm
trying to upload via gulp

upload path is set to "/home/ec2-user" and that's where it would put
deploy.zip in 0.0.6

here's what I get now:

[gulp] SFTP error or directory exists: Error: No such file 
home/ec2-user/node_modules

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: No such file
    at SFTP._parse 
    (C:\Dropbox\work\protobox\web\cookpanion\node_modules\gulp-sftp\node_modules\ssh2\lib\SFTP\SFTPv3.js:986:23)
    at ChannelStream.<anonymous> 
    (C:\Dropbox\work\protobox\web\cookpanion\node_modules\gulp-sftp\node_modules\ssh2\lib\SFTP\SFTPv3.js:49:12)
    at ChannelStream.EventEmitter.emit [as _emit] (events.js:95:17)
    at ChannelStream.emit 
    (C:\Dropbox\work\protobox\web\cookpanion\node_modules\gulp-sftp\node_modules\ssh2\lib\Channel.js:613:12)
    at Parser.<anonymous> 
    (C:\Dropbox\work\protobox\web\cookpanion\node_modules\gulp-sftp\node_modules\ssh2\lib\Channel.js:95:20)
    at Parser.EventEmitter.emit (events.js:95:17)
    at Parser.parsePacket 
    (C:\Dropbox\work\protobox\web\cookpanion\node_modules\gulp-sftp\node_modules\ssh2\lib\Parser.js:596:12)
    at Parser.execute 
    (C:\Dropbox\work\protobox\web\cookpanion\node_modules\gulp-sftp\node_modules\ssh2\lib\Parser.js:249:14)
    at Socket.<anonymous> 
    (C:\Dropbox\work\protobox\web\cookpanion\node_modules\gulp-sftp\node_modules\ssh2\lib\Connection.js:515:18)
    at Socket.EventEmitter.emit (events.js:95:17)

I tried adding {base: "./node_modules"} to the source file stream, didn't
have an effect

when I tried saving and uploading the zip in root instead of node_modules,
I got a 0 byte file in the right place on the server, and gulp hangs on

[gulp] SFTP :: SFTP session closed


Reply to this email directly or view it on GitHub:
#2 (comment)

@zoltanradics
Copy link

My errors are similar, but after some experimenting i realized that:

If i set remotePath as 'example-folder/', it's works fine and uploads the files even if i add 'some-folder/**' so Gulp will upload all my files in the selected folder recursively. This is cool!
However if i set remotePath as 'example-folder/subfolder' than got similar error than above.

@kishu27
Copy link

kishu27 commented Jan 22, 2016

I was having this issue in Mac OS X (Yosemite). So it's not just a windows thing. The problem got solved after I remove trailing / character from remotePath .

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

4 participants