Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
const currentBranch = require('current-git-branch');
const open = require('open');
const gitRemoteOriginUrl = require('git-remote-origin-url');

module.exports = async () => {
	let remote;

	try {
		remote = await gitRemoteOriginUrl();
	} catch (err) {
		console.log(`Could not read remote origin: ${err}`);
	}

	const branch = currentBranch();

	const projectName = remote.split('git@github.com:')[1].replace(/\.git$/, '');

	let url = `https://github.com/${projectName}/pulls?utf8=%E2%9C%93&q=${branch}`;

	if (branch === 'master') {
		url = `https://github.com/${projectName}`;
	}

	open(url);
};