default-branch
Advanced tools
Comparing version
@@ -31,14 +31,13 @@ 'use strict'; | ||
try { | ||
const regexMatch = regexp.exec(data)[1]; | ||
// The first item (0) will be at the top and will be the default branch | ||
const regexMatch = data.match(regexp)[0].split('=')[1].split('"')[0]; | ||
return resolve(regexMatch); | ||
} catch (err) { | ||
reject(new Error('Failed to get default branch: ' + err)); | ||
return; | ||
return reject(new Error('Failed to get default branch: ' + err)); | ||
} | ||
}); | ||
}).on('error', (error) => { | ||
reject(error); | ||
return reject(error); | ||
}); | ||
}); | ||
}; |
{ | ||
"name": "default-branch", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "Get the default branch of a GitHub repository", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
4650
0.74%46
-2.13%