finish start
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
const _ = require("lodash");
|
||||||
const path = x => require("../" + x);
|
const path = x => require("../" + x);
|
||||||
const immutable = path("js/immutable");
|
const immutable = path("js/immutable");
|
||||||
|
|
||||||
@@ -91,26 +92,23 @@ function gitPush(dp) {
|
|||||||
return exec(cmd).then(x => dp);
|
return exec(cmd).then(x => dp);
|
||||||
}
|
}
|
||||||
|
|
||||||
function doit(dp) {
|
function createFeatureBranch(dp) {
|
||||||
const cmds = [
|
const cmds = [
|
||||||
"git fetch origin -p && git fetch origin --tags",
|
"git fetch origin -p",
|
||||||
`git merge ${dp.mergeBranch}`,
|
"git fetch origin --tags",
|
||||||
`git branch ${dp.featureBranch}`,
|
`git merge origin/${dp.currentBranch}`,
|
||||||
`git checkout ${dp.featureBranch}`,
|
`git checkout -b ${dp.featureBranch}`,
|
||||||
`git push -u origin ${dp.featureBranch}`
|
`git push -u origin ${dp.featureBranch}`
|
||||||
];
|
];
|
||||||
return _.reduce(
|
return _.reduce(
|
||||||
cmds,
|
cmds,
|
||||||
(accum, elem) => {
|
(accum, elem) => {
|
||||||
console.log(elem);
|
|
||||||
return accum
|
return accum
|
||||||
.then(() => exec(elem))
|
.then(() => console.log(elem))
|
||||||
.then(x => {
|
.then(() => console.log())
|
||||||
console.log("STDOUT", x.stdout);
|
.then(() => exec(elem));
|
||||||
console.log("STDERR", x.stderr);
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
Promise.resove({})
|
Promise.resolve({})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,12 +124,5 @@ const x = toPromise({ program })
|
|||||||
.then(setCurrentBranch)
|
.then(setCurrentBranch)
|
||||||
.then(validateCurrentBranch)
|
.then(validateCurrentBranch)
|
||||||
.then(setFeatureBranch)
|
.then(setFeatureBranch)
|
||||||
.then(setMergeBranch)
|
.then(createFeatureBranch)
|
||||||
.then(doit)
|
|
||||||
// .then(gitFetch)
|
|
||||||
// .then(gitMerge)
|
|
||||||
// .then(gitBranch)
|
|
||||||
// .then(gitCheckout)
|
|
||||||
// .then(gitPush)
|
|
||||||
// .then(x => console.log("x", x))
|
|
||||||
.catch(err => console.error(err));
|
.catch(err => console.error(err));
|
||||||
|
|||||||
Reference in New Issue
Block a user