cpr icon indicating copy to clipboard operation
cpr copied to clipboard

Update mkdirp dependency

Open guimard opened this issue 3 years ago • 2 comments

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) {                                       

guimard avatar Oct 21 '20 13:10 guimard

@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.

mfranzke avatar May 25 '21 21:05 mfranzke

Hi @mfranzke, done in #68

Cheers, Yadd

guimard avatar May 26 '21 19:05 guimard