Files
git-utilities/bin/creature-start
2019-07-18 16:09:29 -04:00

29 lines
735 B
JavaScript
Executable File

#!/usr/bin/env node
const _ = require("lodash");
const path = x => require("../" + x);
const git = path("js/git");
const shell = path("js/shell");
const commander = path("js/commander");
const validate = path("js/validate");
function createFeatureBranch(dp) {
return shell.pipeline([
"git fetch --prune --prune-tags --tags origin",
`git merge origin/${dp.branch.current}`,
"git push",
`git checkout -b ${dp.branch.feature}`,
`git push -u origin ${dp.branch.feature}`
]);
}
commander
.start()
.then(git.setCurrentBranch)
.then(validate.currentIsStandardBranch)
.then(git.setFeatureBranch)
.then(validate.featureIsNotStandardBranch)
.then(createFeatureBranch)
.catch(err => console.error(err));