gt8: make the package installable
This commit is contained in:
parent
f3bfe0f905
commit
1f676d6b68
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,3 +2,4 @@ node_modules/
|
|||||||
pnpm-debug.log
|
pnpm-debug.log
|
||||||
pnpm-lock.yaml
|
pnpm-lock.yaml
|
||||||
dist
|
dist
|
||||||
|
git-mikado-*.tgz
|
||||||
|
3
bin/git-mikado.js
Executable file
3
bin/git-mikado.js
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
require('../src/git-mikado.js').run();
|
@ -1,8 +1,11 @@
|
|||||||
{
|
{
|
||||||
"name": "git-mikado",
|
"name": "git-mikado",
|
||||||
"version": "1.0.0",
|
"version": "0.1.0",
|
||||||
"description": "",
|
"description": "Tool using the Mikado method for git branch management",
|
||||||
"main": "index.js",
|
"main": "src/index.js",
|
||||||
|
"bin": {
|
||||||
|
"git-mikado": "./bin/git-mikado.js"
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
},
|
},
|
||||||
|
10
src/git-mikado.js
Normal file → Executable file
10
src/git-mikado.js
Normal file → Executable file
@ -5,10 +5,12 @@ const status = require("./commands/status");
|
|||||||
const done = require("./commands/done");
|
const done = require("./commands/done");
|
||||||
const upstream = require("./commands/upstream");
|
const upstream = require("./commands/upstream");
|
||||||
|
|
||||||
const { currentBranch } = require("./utils");
|
const utils = require("./utils");
|
||||||
|
|
||||||
currentBranch().then((currentBranch) => {
|
module.exports.run = async () => {
|
||||||
yargs
|
const currentBranch = await utils.currentBranch();
|
||||||
|
|
||||||
|
return yargs
|
||||||
.scriptName("git-mikado")
|
.scriptName("git-mikado")
|
||||||
.showHelpOnFail(true)
|
.showHelpOnFail(true)
|
||||||
.command("status", "show status of all mikado branches", status)
|
.command("status", "show status of all mikado branches", status)
|
||||||
@ -74,4 +76,4 @@ currentBranch().then((currentBranch) => {
|
|||||||
.help()
|
.help()
|
||||||
.demandCommand(1, "")
|
.demandCommand(1, "")
|
||||||
.strict().argv;
|
.strict().argv;
|
||||||
});
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user