Skip to content

Appending a file whose name is prefixed with './' is removed when archived #162

@sseixas

Description

@sseixas

This happens in core.js on line 191. The following instruction is executed in the _normalizeDataEntry function: data.name = util.sanitizePath(data.name);

I observed this when calling the archiver.append function. The caller should have the option to sanitize the file name before the call to avoid over sanitation as in this case.

Why does it matter you ask, well I'm writing a gulp task that packages a Heroku slug for deployment. The slug is nothing but a tar archive. However, Heroku specifies that the files in the archive must have the './' prefix. I tested it with and without and as their documentation states, only with the prefix can I get the slug to deploy successfully.

https://devcenter.heroku.com/articles/platform-api-deploying-slugs#create-slug-archive

I have already fixed this locally with a flag to prevent sanitation and will issue a pull request shortly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions