pgherveou / gulp-awspublish

gulp plugin to publish files to amazon s3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Everything gets published inside an empty-named directory

iby opened this issue Β· comments

😟

Basically. This.

image

For some reason, it creates a directory / key, with an empty name, and puts everything in there. I'd expect S3 not to allow this, frankly. This is eu-central-1, which is known for awkward situations. I haven't tested in other regions, but assuming it's ok. I use aws-publish with local Riak-CS instance, which is AWS-compatible storage. No problems there. Other libraries work as expected in eu-central-1.

pipeline = pipeline
    .pipe(rename(function (path) {
        path.dirname = '/' + appConfiguration['release'] + '/' + path.dirname;
    }))
    .pipe(publisher.publish(null, {force: true}))
    .pipe(awspublish.reporter());

Tried removing the first backslash and tried setting the dirname to an empty string. No go. What do you think?

Happens here because of this:

file.path.substring(file.base.length).replace(/\\/g, '/');

When src base parameter to gulp is specified without trailing slash, the resulting aws key will always start with the slash. E.g., path is /foo/bar/baz/qux.json and base is /foo/bar, the key will be /baz/qux.json. I'm used to "absolute" notation where keys start with slash, apparently that's not the way it should be used and probably other libraries get rid of it automatically.

should be fixed in the last release after merging
#81

This is happening again on my side. Seems to have started going wrong about 2 weeks ago. Also using eu-central-1

@kremalicious I'm seeing this again too, were you able to resolve?

@jhulst no, still having the same problem