gt8: make the package installable

main
Yanick Champoux 2021-11-25 11:33:09 -05:00
parent f3bfe0f905
commit 1f676d6b68
4 changed files with 16 additions and 7 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@ node_modules/
pnpm-debug.log
pnpm-lock.yaml
dist
git-mikado-*.tgz

3
bin/git-mikado.js Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env node
require('../src/git-mikado.js').run();

View File

@ -1,8 +1,11 @@
{
"name": "git-mikado",
"version": "1.0.0",
"description": "",
"main": "index.js",
"version": "0.1.0",
"description": "Tool using the Mikado method for git branch management",
"main": "src/index.js",
"bin": {
"git-mikado": "./bin/git-mikado.js"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},

10
src/git-mikado.js Normal file → Executable file
View File

@ -5,10 +5,12 @@ const status = require("./commands/status");
const done = require("./commands/done");
const upstream = require("./commands/upstream");
const { currentBranch } = require("./utils");
const utils = require("./utils");
currentBranch().then((currentBranch) => {
yargs
module.exports.run = async () => {
const currentBranch = await utils.currentBranch();
return yargs
.scriptName("git-mikado")
.showHelpOnFail(true)
.command("status", "show status of all mikado branches", status)
@ -74,4 +76,4 @@ currentBranch().then((currentBranch) => {
.help()
.demandCommand(1, "")
.strict().argv;
});
}