nx/scripts/submit-plugin.js
Jonathan Cammisuli 0a25cfd58f docs(docs): update nx plugin docs with info on how to submit plugin
This also includes a `submit-plugin` utility that will automatically open the browser with the
correct PR template
2020-03-08 18:05:59 -04:00

19 lines
572 B
JavaScript

const open = require('open');
const childProcess = require('child_process');
function createPullRequest() {
const remoteUrl = childProcess
.execSync(`git ls-remote --get-url origin`)
.toString('utf-8')
.trim();
const remoteName = remoteUrl.match(/[\/|:](\w+?)\//)[1];
const branchName = childProcess
.execSync('git rev-parse --abbrev-ref HEAD')
.toString('utf-8')
.trim();
const prUrl = `https://github.com/nrwl/nx/compare/master...${remoteName}:${branchName}?expand=1&template=COMMUNITY_PLUGIN.md`;
open(prUrl);
}
createPullRequest();