@@ -81,12 +81,16 @@ function cachePut (gitref, prop, value) {
8181
8282
8383function fetch ( url , gitref , callback ) {
84- let repo = ( / ^ v 0 \. \d \. / ) . test ( gitref )
85- ? 'node-v0.x-archive'
86- : 'node'
87- url = url . replace ( '{gitref}' , gitref )
84+ let refparts = gitref . split ( '/' )
85+ let repo = refparts [ 0 ] == 'v8-canary'
86+ ? 'node-v8'
87+ : ( / ^ v 0 \. \d \. / ) . test ( refparts [ 1 ] )
88+ ? 'node-v0.x-archive'
89+ : 'node'
90+
91+ url = url . replace ( '{gitref}' , refparts [ 1 ] )
8892 . replace ( '{repo}' , repo )
89- + `?rev=${ gitref } `
93+ + `?rev=${ refparts [ 1 ] } `
9094 hyperquest . get ( url , githubOptions ) . pipe ( bl ( function ( err , data ) {
9195 if ( err )
9296 return callback ( err )
@@ -98,7 +102,7 @@ function fetch (url, gitref, callback) {
98102
99103function fetchNpmVersion ( gitref , callback ) {
100104 var version = cacheGet ( gitref , 'npm' )
101- if ( version || ( / ^ v 0 \. ( [ 0 1 2 3 4 5 ] \. \d + | 6 \. [ 0 - 2 ] ) $ / ) . test ( gitref ) )
105+ if ( version || ( / \/ v 0 \. ( [ 0 1 2 3 4 5 ] \. \d + | 6 \. [ 0 - 2 ] ) $ / ) . test ( gitref ) )
102106 return setImmediate ( callback . bind ( null , null , version ) )
103107
104108 fetch ( npmPkgJsonUrl , gitref , function ( err , rawData ) {
@@ -160,7 +164,7 @@ function fetchV8Version (gitref, callback) {
160164
161165function fetchUvVersion ( gitref , callback ) {
162166 var version = cacheGet ( gitref , 'uv' )
163- if ( version || ( / ^ v 0 \. ( [ 0 1 2 3 4 ] \. \d + | 5 \. 0 ) $ / ) . test ( gitref ) )
167+ if ( version || ( / \/ v 0 \. ( [ 0 1 2 3 4 ] \. \d + | 5 \. 0 ) $ / ) . test ( gitref ) )
164168 return setImmediate ( callback . bind ( null , null , version ) )
165169
166170 fetch ( uvVersionUrl [ 0 ] , gitref , function ( err , rawData ) {
@@ -216,7 +220,7 @@ function fetchUvVersion (gitref, callback) {
216220
217221function fetchSslVersion ( gitref , callback ) {
218222 var version = cacheGet ( gitref , 'ssl' )
219- if ( version || ( / ^ v 0 \. ( [ 0 1 2 3 4 ] \. \d + | 5 \. [ 0 - 4 ] ) $ / ) . test ( gitref ) )
223+ if ( version || ( / \/ v 0 \. ( [ 0 1 2 3 4 ] \. \d + | 5 \. [ 0 - 4 ] ) $ / ) . test ( gitref ) )
220224 return setImmediate ( callback . bind ( null , null , version ) )
221225
222226 fetch ( sslVersionUrl [ 0 ] , gitref , function ( err , rawData ) {
@@ -249,7 +253,7 @@ function fetchSslVersion (gitref, callback) {
249253
250254function fetchZlibVersion ( gitref , callback ) {
251255 var version = cacheGet ( gitref , 'zlib' )
252- if ( version || ( / ^ v 0 \. ( [ 0 1 2 3 4 ] \. \d + | 5 \. [ 0 - 7 ] ) $ / ) . test ( gitref ) )
256+ if ( version || ( / \/ v 0 \. ( [ 0 1 2 3 4 ] \. \d + | 5 \. [ 0 - 7 ] ) $ / ) . test ( gitref ) )
253257 return setImmediate ( callback . bind ( null , null , version ) )
254258
255259 fetch ( zlibVersionUrl , gitref , function ( err , rawData ) {
@@ -267,7 +271,7 @@ function fetchZlibVersion (gitref, callback) {
267271
268272function fetchModVersion ( gitref , callback ) {
269273 var version = cacheGet ( gitref , 'mod' )
270- if ( version || ( / ^ v 0 \. 1 \. \d + $ / ) . test ( gitref ) )
274+ if ( version || ( / \/ v 0 \. 1 \. \d + $ / ) . test ( gitref ) )
271275 return setImmediate ( callback . bind ( null , null , version ) )
272276
273277 fetch ( modVersionUrl [ 0 ] , gitref , function ( err , rawData ) {
0 commit comments