File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,13 +17,17 @@ module.exports = {
1717 if ( version ) return version ;
1818
1919 var package = JSON . parse ( fs . readFileSync ( 'package.json' , 'UTF-8' ) ) ;
20- // TODO(brian): change `(-|rc)` to `-` in the regex below after bower
21- // fixes this issue: https://github.com/bower/bower/issues/782
22- var match = package . version . match ( / ^ ( [ ^ \- ] * ) (?: ( - | r c ) ( .+ ) ) ? $ / ) ;
20+ var match = package . version . match ( / ^ ( [ ^ \- ] * ) (?: \- ( .+ ) ) ? $ / ) ;
2321 var semver = match [ 1 ] . split ( '.' ) ;
2422 var hash = shell . exec ( 'git rev-parse --short HEAD' , { silent : true } ) . output . replace ( '\n' , '' ) ;
2523
26- var fullVersion = ( match [ 1 ] + ( match [ 2 ] ? '-' + hash : '' ) ) ;
24+ var fullVersion = match [ 1 ] ;
25+
26+ if ( match [ 2 ] ) {
27+ fullVersion += '-' ;
28+ fullVersion += ( match [ 2 ] == 'snapshot' ) ? hash : match [ 2 ] ;
29+ }
30+
2731 version = {
2832 full : fullVersion ,
2933 major : semver [ 0 ] ,
You can’t perform that action at this time.
0 commit comments