Skip to content

Documentation on how to keep zip folder structure #28

@thiagomajesk

Description

@thiagomajesk

Hi! I noticed that when unzipping files it only extracts the content from the zip directly to the destination. Is there a way to keep the zip name as part of the path?

This is part of my task:

download(links)
    .pipe(unzip(unzipOptions))
    .pipe(svgo())
    .pipe(gulp.dest('static'))

For this scenario, given two files with the folder structure bellow:

foo.svg.zip
|--icons
   |-- foo-01.svg
   |-- foo-02.svg

bar.svg.zip
|--icons
   |-- bar-01.svg
   |-- bar-02.svg

The result should be:

|-- static
    |-- foo
    |   |-- icons
    |       |-- foo-01.svg
    |       |-- foo-02.svg
    |-- bar
        |-- icons
            |-- bar-01.svg
            |-- bar-02.svg

Instead of:

|-- static
    |-- icons
        |-- foo-01.svg
        |-- foo-02.svg
        |-- bar-01.svg
        |-- bar-02.svg

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions