@@ -81,12 +81,16 @@ function cachePut (gitref, prop, value) {
81
81
82
82
83
83
function 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 ] )
88
92
. replace ( '{repo}' , repo )
89
- + `?rev=${ gitref } `
93
+ + `?rev=${ refparts [ 1 ] } `
90
94
hyperquest . get ( url , githubOptions ) . pipe ( bl ( function ( err , data ) {
91
95
if ( err )
92
96
return callback ( err )
@@ -98,7 +102,7 @@ function fetch (url, gitref, callback) {
98
102
99
103
function fetchNpmVersion ( gitref , callback ) {
100
104
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 ) )
102
106
return setImmediate ( callback . bind ( null , null , version ) )
103
107
104
108
fetch ( npmPkgJsonUrl , gitref , function ( err , rawData ) {
@@ -160,7 +164,7 @@ function fetchV8Version (gitref, callback) {
160
164
161
165
function fetchUvVersion ( gitref , callback ) {
162
166
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 ) )
164
168
return setImmediate ( callback . bind ( null , null , version ) )
165
169
166
170
fetch ( uvVersionUrl [ 0 ] , gitref , function ( err , rawData ) {
@@ -216,7 +220,7 @@ function fetchUvVersion (gitref, callback) {
216
220
217
221
function fetchSslVersion ( gitref , callback ) {
218
222
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 ) )
220
224
return setImmediate ( callback . bind ( null , null , version ) )
221
225
222
226
fetch ( sslVersionUrl [ 0 ] , gitref , function ( err , rawData ) {
@@ -249,7 +253,7 @@ function fetchSslVersion (gitref, callback) {
249
253
250
254
function fetchZlibVersion ( gitref , callback ) {
251
255
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 ) )
253
257
return setImmediate ( callback . bind ( null , null , version ) )
254
258
255
259
fetch ( zlibVersionUrl , gitref , function ( err , rawData ) {
@@ -267,7 +271,7 @@ function fetchZlibVersion (gitref, callback) {
267
271
268
272
function fetchModVersion ( gitref , callback ) {
269
273
var version = cacheGet ( gitref , 'mod' )
270
- if ( version || ( / ^ v 0 \. 1 \. \d + $ / ) . test ( gitref ) )
274
+ if ( version || ( / \/ v 0 \. 1 \. \d + $ / ) . test ( gitref ) )
271
275
return setImmediate ( callback . bind ( null , null , version ) )
272
276
273
277
fetch ( modVersionUrl [ 0 ] , gitref , function ( err , rawData ) {
0 commit comments