Closed navFooh closed 9 years ago
It should handle that automatically and you should not have to do anything special to make it work. Which version are you on? There was a bug in the older version which would cause that to error out and not upload but I believe it was resolved in recent builds. If your on the latest version (0.2.6 I believe) and this is still happening I will take a look.
I'm on 0.2.6, but seem to have that problem. It works when the folders already exist on the server, but when I select a new folder as 'dest' and include:
src: [
'scripts/vendor/requirejs/require.js'
]
I get:
If I use:
src: [
'scripts',
'scripts/vendor',
'scripts/vendor/requirejs',
'scripts/vendor/requirejs/require.js'
]
I get:
Thanks for the quick response, would be great if you could have a look! Very nice and clean plugin otherwise.
Ok, Ill take a look and post here once I can find something.
Alright I think I have a fix for you, if your up for testing this patch out I will put the instructions below, if not, I plan on pushing to git later tonight and publishing to npm sometime tomorrow after some more testing so you can grab the latest from either once its pushed.
Here is the patch if your interested, in your node_modules directory, look for
grunt-ftp-push/tasks/ftp_push.js
around line 102 in the createDirectoriesForDestination
function
replace the following:
fileObjects.forEach(function (fileItem) {
if (fileItem.dest) {
// Prepare the destination, then push into array for processing
preparedDestination = destination + normalizeDir(fileItem.dest);
destinations.push(preparedDestination);
}
});
with this:
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);
}
});
Hi Robert, just tested it and works perfectly now. Thanks!
Great thanks The patch is up now on npm.
When you want to upload a file that's nested several folders deep, for example: 'scripts/vendor/requirejs/require.js', the containing folders are not created correctly.
In order to create the parent folders correctly, it seems you have to include:
Is this expected behavior or are there tricks to make this work correctly?
Cheers, Thijs