Skip to content
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

Patch for localPath is not defined in addLocalFolderAsync2 #549

Open
sdurham opened this issue Jan 8, 2025 · 0 comments
Open

Patch for localPath is not defined in addLocalFolderAsync2 #549

sdurham opened this issue Jan 8, 2025 · 0 comments

Comments

@sdurham
Copy link

sdurham commented Jan 8, 2025

Need to add a "const " in front of that first localPath usage.

This is the patch I'm using for my own code:

package.json:

"dependencies": {
    "adm-zip": "patch:adm-zip@npm%3A0.5.16#~/.yarn/patches/adm-zip-npm-0.5.16-4556fea098.patch",
...

.yarn/patches/adm-zip-npm-0.5.16-4556fea098.patch

diff --git a/adm-zip.js b/adm-zip.js
index 31dddf2b39c3a0956102a25c984e02a1c3e3b83b..82ad4cd945c870ce92d306928078985a3b0d08a3 100644
--- a/adm-zip.js
+++ b/adm-zip.js
@@ -485,7 +485,7 @@ module.exports = function (/**String*/ input, /** object */ options) {
         addLocalFolderAsync2: function (options, callback) {
             const self = this;
             options = typeof options === "object" ? options : { localPath: options };
-            localPath = pth.resolve(fixPath(options.localPath));
+            const localPath = pth.resolve(fixPath(options.localPath));
             let { zipPath, filter, namefix } = options;
 
             if (filter instanceof RegExp) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant