Created
July 4, 2020 06:56
-
-
Save amitsingh-007/93a99ba740d276ecaa401c2f67f1f600 to your computer and use it in GitHub Desktop.
Construct the command to be executed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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