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

Files created as folders #18

Closed navFooh closed 9 years ago

navFooh commented 9 years ago

Me again.. Noticed an issue in the new release.

With the same setup as issue #17, parent folders are now created correctly. But the uploaded file will be created as a folder on the server:

image

Then it fails to write the file itself.

Robert-W commented 9 years ago

Is this version 3.0, I noticed this same behavior on my initial patch but then made some changes and it worked on my side. If you are on 3.0 I will look again but that looks like the results from 2.8.

screen shot 2015-01-14 at 3 06 36 pm

Robert-W commented 9 years ago

lines 102 to 112 should look like below:


fileObjects.forEach(function (fileItem) {
      if (fileItem.dest) {
        // Prepare the destination, then push into array for processing
        preparedDestination = destination + normalizeDir(fileItem.dest);
        destinations.push(preparedDestination);
      } else {
        // Prepare the destination, then push into array for processing
        preparedDestination = destination + fileItem.path;
        destinations.push(preparedDestination);
      }
    });

the main part to look at is in the else, if it reads destination + normalizeDir(fileItem.path) then your on 2.8, it should read like below. preparedDestination = destination + fileItem.path;

navFooh commented 9 years ago

You're right I'm on 0.2.8. I did an: npm update grunt-ftp-push --save-dev and it did update, so I assumed I was on the latest version.

I'll check out the latest one and confirm in a bit

navFooh commented 9 years ago

All working properly, thanks!

Robert-W commented 9 years ago

Awesome, good to hear, sorry about that.