more start

This commit is contained in:
rkiel
2019-07-14 16:56:47 -04:00
parent 6d41728543
commit 38dd62aea1

View File

@@ -86,11 +86,34 @@ function gitCheckout(dp) {
} }
function gitPush(dp) { function gitPush(dp) {
const cmd = `git push origin ${dp.featureBranch}`; const cmd = `git push -u origin ${dp.featureBranch}`;
console.log(cmd); console.log(cmd);
return exec(cmd).then(x => dp); return exec(cmd).then(x => dp);
} }
function doit(dp) {
const cmds = [
"git fetch origin -p && git fetch origin --tags",
`git merge ${dp.mergeBranch}`,
`git branch ${dp.featureBranch}`,
`git checkout ${dp.featureBranch}`,
`git push -u origin ${dp.featureBranch}`
];
return _.reduce(
cmds,
(accum, elem) => {
console.log(elem);
return accum
.then(() => exec(elem))
.then(x => {
console.log("STDOUT", x.stdout);
console.log("STDERR", x.stderr);
});
},
Promise.resove({})
);
}
function toPromise(dp) { function toPromise(dp) {
return Promise.resolve(dp); return Promise.resolve(dp);
} }
@@ -103,11 +126,12 @@ const x = toPromise({ program })
.then(setCurrentBranch) .then(setCurrentBranch)
.then(validateCurrentBranch) .then(validateCurrentBranch)
.then(setFeatureBranch) .then(setFeatureBranch)
.then(gitFetch)
.then(setMergeBranch) .then(setMergeBranch)
.then(gitMerge) .then(doit)
.then(gitBranch) // .then(gitFetch)
.then(gitCheckout) // .then(gitMerge)
.then(gitPush) // .then(gitBranch)
// .then(gitCheckout)
// .then(gitPush)
// .then(x => console.log("x", x)) // .then(x => console.log("x", x))
.catch(err => console.error(err)); .catch(err => console.error(err));