File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ const path = require('path');
22const  fs  =  require ( 'fs' ) ; 
33const  mkdirp  =  require ( 'mkdirp' ) ; 
44const  chalk  =  require ( 'chalk' ) ; 
5+ const  isEqual  =  require ( 'lodash.isequal' ) 
56
67const  { 
78  writeYaml, 
@@ -87,10 +88,10 @@ module.exports = function(openapi, openapiDir) {
8788        for  ( const  componentName  of  Object . keys ( openapi . components [ componentType ] ) )  { 
8889          const  filename  =  path . join ( compDir ,  componentName )  +  '.yaml' ; 
8990          const  componentData  =  openapi . components [ componentType ] [ componentName ] ; 
90-           if  ( fs . existsSync ( filename ) )  { 
91+           if  ( fs . existsSync ( filename )   &&   isEqual ( readYaml ( filename ) ,   componentData ) )  { 
9192            console . warn ( 
9293              chalk . yellow ( 
93-                 `warning: conflict for ${ componentName }   - file already exists: ${ chalk . blue (  
94+                 `warning: conflict for ${ componentName }   - file already exists with different content : ${ chalk . blue (  
9495                  filename  
9596                ) }   ... Skip.`
9697              ) 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments