#!/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));