Yanick Champoux 2021-11-18 19:54:41 -05:00
parent 67c9964997
commit f497fde8ad
4 changed files with 86 additions and 78 deletions

17
TODO Normal file
View File

@ -0,0 +1,17 @@
- show icons for branches
👷 - U+1F477 - CONSTRUCTION WORKER
🤝
🙋 - U+1F64B - HAPPY PERSON RAISING ONE HAND
🍷 - U+1F377 - WINE GLASS
🍸 - U+1F378 - COCKTAIL GLASS
🔍 - U+1F50D - LEFT-POINTING MAGNIFYING GLASS
🔎 - U+1F50E - RIGHT-POINTING MAGNIFYING GLASS
🥃 - U+1F943 - TUMBLER GLASS
🥛 - U+1F95B - GLASS OF MILK
🥃 - U+1F943 - TUMBLER GLASS
✨ - U+02728 - SPARKLES
⛔ - U+026D4 - NO ENTRY
🚫 - U+1F6AB - NO ENTRY SIGN
- list branch in cyclic order

View File

@ -8,7 +8,7 @@ module.exports = async (yargs) => {
const current = await currentBranch();
console.log(`marking branch '$current' as done`);
console.log(`marking branch '${current}' as done`);
await Git().addConfig( `branch.${current}.mikado-done`, true );

View File

@ -40,9 +40,7 @@ module.exports = async (yargs) => {
await checkWorkspaceClean();
const branch = yargs.branch;
const upstream = await currentBranch();
const {branch,upstream} = yargs;
const base = yargs.base ?? await getBaseBranch(upstream);

View File

@ -1,39 +1,31 @@
const yargs = require("yargs");
const new = require("./commands/new");
const newCommand = require("./commands/new");
const status = require("./commands/status");
const done = require("./commands/done");
const upstream = require("./commands/upstream");
const { currentBranch } = require('./utils');
const { currentBranch } = require("./utils");
currentBranch().then(
currentBranch => {
yargs
currentBranch().then((currentBranch) => {
yargs
.scriptName("git-mikado")
.showHelpOnFail(true)
.command(
"status",
"show status of all mikado branches",
status
)
.command("status", "show status of all mikado branches", status)
.command(
"done [branch]",
"set branch as done",
(yargs) => {
return yargs
.positional("branch", {
return yargs.positional("branch", {
describe: "branch to mark as done",
default: currentBranch
})
default: currentBranch,
});
},
done
)
.command(
"upstream [upstream]",
"set branch as done",
"set an upstream of the current branch",
(yargs) => {
return yargs
.positional("upstream", {
@ -62,11 +54,13 @@ yargs
})
.option("upstream", {
alias: "u",
describe: "branch that is dependent on the new branch",
default: currentBranch,
describe:
"branch that is dependent on the new branch",
})
.demandOption(["branch"]);
},
new
newCommand
)
.fail((msg, err, yargs) => {
try {
@ -80,5 +74,4 @@ yargs
.help()
.demandCommand(1, "")
.strict().argv;
});