File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,8 @@ let filteredTags = [];
9090 * @returns  number array or undefined 
9191 */ 
9292function  parseVersion ( str )  { 
93-   const  versionReg  =  / ^ v ? ( \d + ) \. ( \d + ) \. ( \d + ) $ / i; 
93+   // there is no ending "$", because of "rc"-like versions 
94+   const  versionReg  =  / ^ v ? ( \d + ) \. ( \d + ) \. ( \d + ) / i; 
9495
9596  const  match  =  versionReg . exec ( str ) ; 
9697
@@ -105,12 +106,23 @@ function parseVersion(str) {
105106    return  parsed ; 
106107  } 
107108
109+   // special case, to not log a warning 
110+   if  ( str  ===  "test" )  { 
111+     return  undefined ; 
112+   } 
113+ 
114+   console . log ( `Failed to parse version! got: ${ str }  ) ; 
115+ 
108116  return  undefined ; 
109117} 
110118
119+ /** 
120+  * Get versions from git tags and put them into {@link  filteredTags} 
121+  */ 
111122function  getVersions ( )  { 
112123  // get all tags from git 
113-   const  res  =  childProcess . execSync ( "git tag" ) . toString ( ) ; 
124+   // "trim" is used to remove the ending new-line 
125+   const  res  =  childProcess . execSync ( "git tag" ) . toString ( ) . trim ( ) ; 
114126
115127  filteredTags  =  res . split ( '\n' ) 
116128  // map all gotten tags if they match the regular expression 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments