gtg092x / gulp-sftp

Gulp SFTP Deploy
140 stars 61 forks source link

Folder Creation on Server #26

Closed rdallaire closed 9 years ago

rdallaire commented 9 years ago

I am having issues with nested folders being created on the server. It doesn't seem to like remotePath: '/assets/img' it will however do `remotePath: '/assets/``

My config

        .pipe(plugins.sftp(
                {
                    host: '-----',
                    user: 'r-----',
                    pass: '---',
                    remotePath: '/assets/img'
                }
            ))
[16:22:54] Starting 'images'...
[16:22:56] Finished 'images' after 1.85 s
[16:22:56] Authenticating with password.
[16:22:56] gulp-imagemin: Minified 12 images (saved 36.01 kB - 15.7%)
[16:22:57] SFTP error or directory exists: Error: No such file /assets/img

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: No such file
    at SFTPStream._transform (c:\dev\crystal\Jello\node_modules\gulp-sftp\node_modules\ssh2\node_modules\ssh2-streams\lib\sftp.js:354:27)
    at SFTPStream.Transform._read [as __read] (_stream_transform.js:179:10)
    at SFTPStream._read (c:\dev\crystal\Jello\node_modules\gulp-sftp\node_modules\ssh2\node_modules\ssh2-streams\lib\sftp.js:160:15)
    at SFTPStream.Transform._write (_stream_transform.js:167:12)
    at doWrite (_stream_writable.js:223:10)
    at writeOrBuffer (_stream_writable.js:213:5)
    at SFTPStream.Writable.write (_stream_writable.js:180:11)
    at write (_stream_readable.js:583:24)
    at flow (_stream_readable.js:592:7)
    at Channel.pipeOnReadable (_stream_readable.js:624:5)
gtg092x commented 9 years ago

Can you try adding a trailing slash to img? Also, which OS do you have for client and server?

rdallaire commented 9 years ago

I am using a different way with gulp-sftp now and it seems to work fine now. Going to close this.

I think it may have had to do with the slash at the beginning of remotePath