gia-cli
Version:
Guardian US Interactive CLI tool
14 lines (10 loc) • 383 B
JavaScript
var fs = require( 'fs' );
var path = require( 'path' );
module.exports = function () {
var gitConfig = fs.readFileSync( path.join( __dirname, '../../.git/config' ), 'utf-8' );
var match = /url = git@bitbucket\.org:gia_src\/(.+).git/.exec( gitConfig );
if ( !match ) {
console.error( 'Could not find repo URL :-S' );
}
return 'https://bitbucket.org/gia_src/' + match[1];
};