Robert-W / grunt-ftp-push

Deploy files to an FTP server as part of your Grunt workflow.
MIT License
39 stars 14 forks source link

Relative files are written to wrong destination #27

Closed rarila closed 9 years ago

rarila commented 9 years ago

IMHO relative files are written to wrong destination. Example:

Say we have the file sources/includes/foo.js and the following setting:

    options: {
        dest: 'web'
    },
    target: {
        files: [{
            expand: true,
            cwd: 'sources/includes',
            src: '*.js',
            dest: 'inc'
        }]
    }

The file gets written to web/inc/sources/includes/foo.js at the moment what I think isn't the desired behavior. Otherwise why would we set files…cwd instead of just having the path in files…dest.

IMHO the correct and expected result path would be web/inc/foo.js

resulting path = root path + relative dest path + cwd relative file path

Robert-W commented 9 years ago

This looks like an old issue that we encountered in the past and I thought was resolved, we have trimLeadingCwd specifically for this. I will try to test this configuration tonight or tomorrow and see if I can repro this issue but this should have already been resolved.

rarila commented 9 years ago

Ok, thanks!

Robert-W commented 9 years ago

May hold off on this one for a short bit. Version 0.4.0 should be coming soon and I will make sure to include this in that branch, if releasing that version takes too long I will come back here to do some testing and then merge this in. Same with the other PR that is still open.

You can check out branch 0.4.0 if you like, although currently the ftp_push.js is the same, I am just building out a separate utils file and some unit tests for that at the moment, changes to the ftp_push file will be up soon.

rarila commented 9 years ago

Ok

Robert-W commented 9 years ago

This should be taken care of in the latest branch, closing this now, if you notice its still happening please reopen an issue or pull request on 0.4.0. Thanks.