diff --git a/.gitignore b/.gitignore index 018a157..e4ff719 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ node_modules/ pnpm-debug.log pnpm-lock.yaml dist +git-mikado-*.tgz diff --git a/bin/git-mikado.js b/bin/git-mikado.js new file mode 100755 index 0000000..56e6cd1 --- /dev/null +++ b/bin/git-mikado.js @@ -0,0 +1,3 @@ +#!/usr/bin/env node + +require('../src/git-mikado.js').run(); diff --git a/package.json b/package.json index c5aa4d0..338c6e6 100644 --- a/package.json +++ b/package.json @@ -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" }, diff --git a/src/git-mikado.js b/src/git-mikado.js old mode 100644 new mode 100755 index 2440a1c..7d6f059 --- a/src/git-mikado.js +++ b/src/git-mikado.js @@ -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; -}); +}