jstuckey / gulp-gzip

Gzip plugin for gulp.
MIT License
175 stars 17 forks source link

How to include a parent folder in the zip package #35

Closed blachawk closed 3 years ago

blachawk commented 3 years ago

I am using your package successfully which is zipping everything I need within a specific folder except the parent folder itself. Are there any parameters we can use to either include the parent folder, or create a parent folder that wraps the zipped content? The name of my parent folder is called astra-child. It's a child theme folder for a WordPress project I am working on.

This is what I am using within an npm & gulpfile.babel.js setup....

import gzip from 'gulp-zip';

//LATER...

const paths = {
  packageWP: {
    src: ['**/*','!.vscode{,/**}','!inc{,/**}','!node_modules{,/**}','!packaged{,/**}','!src{,/**}','!.babelrc','!.gitignore'],
    dest: 'packaged'
  }
}

//LATER...

export const packageWP = () => {
  return gulp.src(paths.packageWP.src)
  .pipe(gzip(`astra-child.zip`))
  .pipe(gulp.dest(paths.packageWP.dest));
}

//LATER...
export const _prod = gulp.series(...all my stuff...);
export const _package = gulp.series(_prod,packageWP);

If I run gulp _package from my terminal, it will execute your zip package and package all my child theme assets, except the parent folder itself.

What should I do to include the parent folder?

blachawk commented 3 years ago

I stand corrected. this is a non-issue, as a parent folder is generated when I follow my normal process.