Open benblamey opened 8 years ago
I briefly attempted to debug the issue, and noticed the following in aws_s3.js
i.e. the missing 'cwd' is present on the copy of the object in the 'orig' property, but not in the filepair itself?!
Sorry! Only just seen this. Thanks for having a deeper look as well. Maybe this line should read filePair.differential && !filePair.orig.cwd
? Can you try it that way. If it does work for you, I'm happy to take a PR or I can make the change if you prefer. Let me know!
I tried the change as suggested - and I get a different error:
Running "aws_s3:dist" (aws_s3) task
Deleting the content of https://s3-eu-west-1.amazonaws.com/xxxxxx/
Fatal error: Path must be a string. Received undefined
Hello i see in README file that (delete: will only delete the files which don't exist locally) but no example how it work, can anyone tell me how ?
Thanks.
j'ai trouvé il fallait que je rajoute un / a dest et mettre differential: true et cwd dans les options.
Merci.
Any updates about this?
@trioni do you have the same error as OP or something different?
@MathieuLoutre yes, this error Fatal error: Differential delete needs a "cwd"
.
Currently using npm-scripts and the aws cli to achieve the same thing:
AWS_PROFILE=myprofile aws s3 sync ./public/build-$npm_package_version s3://mybucket/public --delete --region some-region
Having tested a few ways it looks like slashes in dirs aren't to blame, but using expand:true where action is delete causes the problem.
Given that no src is needed where action = delete, does 'expand:true' do anything anyway?
ie, this works unless I uncomment the expand under the 'delete' section:
dev: {
options: {
// differential: true,
},
files: [/* files key pairs */
{
action: 'upload', // send any files not currently present on remote
expand: true,
cwd: staticRootDir,
src: [ 'v2/**/*.png', '!uploads/**', '!**/img-raw/**'], // one subdir for testing
dest: 'domain_com/d/static-testing/', /* s3 destination */
differential: true,
/* headers: {} /* override headers */
},
{
action: 'delete', // remove any files not longer present locally
// expand: true,
// src: '**/*.png',
dest: 'domain_com/d/static-testing/', /* s3 destination */
differential: true,
cwd: staticRootDir,
/* headers: {} /* override headers */
}
]
}
Note that the trailing '/' on dest in the delete block is critically important if you don't want to delete every single file in the bucket.
I'm currently using the "upload" action; without any problem. When I try to perform a differential delete, I get the following error: Fatal error: Differential delete needs a "cwd"
This is my Gruntfile.js