Skip to content

Instantly share code, notes, and snippets.

@amitsingh-007
Created July 4, 2020 06:56
Show Gist options
  • Save amitsingh-007/93a99ba740d276ecaa401c2f67f1f600 to your computer and use it in GitHub Desktop.
Save amitsingh-007/93a99ba740d276ecaa401c2f67f1f600 to your computer and use it in GitHub Desktop.
Construct the command to be executed
const minimist = require("minimist");
const chalk = require("chalk");
const log = console.log;
const error = chalk.bold.red;
const debug = chalk.bold.green;
const info = chalk.rgb(215, 135, 95);
/* argv has all the user arguements
* Visit https://github.com/substack/minimist
* to know more about the parsed arguemnts
*/
const argv = minimist(process.argv.slice(2));
async function getCommand() {
const [baseBranch, targetBranch] = getPRDetails();
const shouldUpdateSnapshots = argv["u"];
const args = ["--colors"];
if (shouldUpdateSnapshots) {
args.push("-u");
}
args.push("--changedSince", `origin/${baseBranch}`);
executeCommand(args);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment