Last active
December 20, 2019 07:55
-
-
Save farmanp/90d6c96d00ddd1913db8752e5f37d8e5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// var branch = process.argv.slice(2).join('_'); | |
// console.log(`Branch name: ${branch}`); | |
// console.log(`Copy and paste below`); | |
// console.log(`git checkout -b ${branch}`); | |
function execute(command) { | |
const exec = require('child_process').exec | |
exec(command, (err, stdout, stderr) => { | |
process.stdout.write(stdout) | |
}) | |
} | |
const readline = require("readline"); | |
const rl = readline.createInterface({ | |
input: process.stdin, | |
output: process.stdout | |
}); | |
rl.question("Ticket number: ", function(tNumber) { | |
rl.question("Ticket name: ", function(tName) { | |
var branch = tName.replace(/ /g, "_").toLowerCase(); | |
console.log(`Branch name: ${branch}`); | |
console.log(`Running the following command: git checkout -b story/${tNumber}/${branch}`); | |
execute(`git checkout -b story/${tNumber}/${branch}`) | |
rl.close(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment