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

Update mkdirp dependency #65

Open
guimard opened this issue Oct 21, 2020 · 2 comments
Open

Update mkdirp dependency #65

guimard opened this issue Oct 21, 2020 · 2 comments

Comments

@guimard
Copy link

guimard commented Oct 21, 2020

Hi,

this patch looks enough to update mkdirp dependency to ^1.0.3:

--- a/lib/index.js                                                                                
+++ b/lib/index.js                                                                                
@@ -121,12 +121,12 @@                                                                             
                     err.errno = 27;                                                              
                     options.errors.push(err);                                                    
                 } else {                                                                         
-                    mkdirp(to, stat.mode, stack.add(function(err) {                              
+                    mkdirp(to, stat.mode).catch((err) => {stack.add(function(err) {              
                         /*istanbul ignore next*/                                                 
                         if (err) {                                                               
                             options.errors.push(err);                                            
                         }                                                                        
-                    }));                                                                         
+                    })});                                                                        
                 }                                                                                
             }));                                                                                 
         }                                                                                        
@@ -139,7 +139,7 @@                                                                               
                                                                                                  
 var copyFile = function(from, to, options, callback) {                                           
     var dir = path.dirname(to);                                                                  
-    mkdirp(dir, function() {                                                                     
+    mkdirp(dir).then( () => {                                                                    
         fs.stat(to, function(statError) {                                                        
             var err;                                                                             
             if(!statError && options.overwrite !== true) {                                       
@mfranzke
Copy link

@guimard do you have the chance in providing this code as a pull request? snyk has even already opened a pull request, but without the suggested code changes that you listed here obviously. A pull request might be easier to accept and merge than just an issue.

guimard added a commit to guimard/cpr that referenced this issue May 26, 2021
@guimard
Copy link
Author

guimard commented May 26, 2021

Hi @mfranzke,
done in #68

Cheers,
Yadd

guimard added a commit to guimard/cpr that referenced this issue May 26, 2021
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

2 participants