Compress directory to zip wit this directory inside using glob and ignore functionality
Hello.
I want to add my directory to a zip archive and exclude some files and folders. It works ok if I do it like this:
archive
.glob('**/*', {
cwd: currentDir,
ignore: ['.git*'],
}, {});
But it put all files and folders from my selected directory to the zip. I want to put the selected Directory to the zip, not only files and folders from this Directory.
For example: zip should contain:
zip:
|--- myDirectory
|--- some file
|--- some folder
But what I've got:
zip:
|--- some file
|--- some folder
I know that if I will use the following code, I will reach what I want about the Directory, but in this case I can't to exclude files and folders:
archive.directory(currentDir, 'myDirectory');
Could you help me with this issue?
Thanks
Your means is the zip file should be contains currentDir?, Try use prefix entry data option?
@aliuq
Your means is the zip file should be contains currentDir?, Try use prefix entry data option?
Thanks, that's what I needed!