-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.glob() with options.cwd is not working at 5.x #455
Comments
This was communicated in the changes for 5.0. Its also why it was released as a new major version per semver. please provide an example of your usage |
I ran into the same problem, found the breaking change note in the changelog, and updated my usage: -archive.glob('../frontend/build/static/js/main.*.js', null, { name: 'ghost-inspector.js', prefix });
+archive.glob('main.*.js', { cwd: '../frontend/build/static/js/'}, { name: 'ghost-inspector.js', prefix }); However the problem I'm having now is that it doesn't seem to be using EDIT: it appears in the previous version, it only overwrote the entrydata |
@simpixelated can you provide sn example of file names inside archive and expected names? |
filename inside the archive (matches original filename):
expected (with
|
Here is my use-case. I have files in |
@hyoo you should be able to do that with: archive.directory('a/b/c1', 'c1') |
I feel like an idiot but I can't seem to get glob working. I have an array of paths that I want. I'm confused by const output = fs.createWriteStream('output.zip')
const allowedItems = [
'file.xml',
'directory1',
'directory2',
]
archiver.pipe(output)
archiver.directory('/a/directory/path', false)
for (const path of allowedItems) {
archiver.glob(path, { cwd: '????' })
}
archiver.finalize() Is it the relative path of the real file path or what it will be in the zip? Thanks! |
|
Just found the source problem, in the pr
#433
The non-backward compatibility needs to be documented or clearly communicated to the users !!!
Is there any workaround that can avoid including absolute path?
The text was updated successfully, but these errors were encountered: