git-notify
Version:
Communicate important updates to your team via git commit messages
3 lines (2 loc) • 2.11 kB
JavaScript
function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=e(require("meow")),o=e(require("detect-newline")),n=e(require("boxen")),i=e(require("chalk")),r=e(require("simple-git")),c=e(require("git-raw-commits"));function a(e,t){const o=i[t.color],r=o||i.hex(t.color),c=o||t.color.startsWith("#")?t.color:"#"+t.color,a=t.simple?r(e):n(e,{padding:1,margin:1,borderStyle:"doubleSingle",borderColor:c,float:"center",align:"center"});console.log(a)}const s=r(),l=t('\n\tUsage\n\t $ git-notify <method> [options] $GIT_PARAMS\n\n Methods\n since <commit> show all notifications since commit\n merge run on git pull/merge\n rewrite run on git rebase\n checkout run on git checkout/switch\n\n\tOptions\n --prefix, -p prefix to look for in commit messages (default: "git-notify:")\n --simple, -s show a plain, unboxed notification\n --color, -c color of displayed notification\n\n\tExamples\n $ git-notify since HEAD~5\n $ git-notify checkout $GIT_PARAMS --prefix "@everyone:"\n $ git-notify merge $GIT_PARAMS --simple --color "#ff6f6f"\n',{flags:{toast:{type:"boolean",alias:"t"},simple:{type:"boolean",alias:"s"},prefix:{type:"string",alias:"p",default:"git-notify:"},color:{type:"string",alias:"c",default:"#ff6f6f",description:"hex value like #ff0000, or one of: black, red, green, yellow, blue, magenta, cyan, white, gray"}}});!async function(e,t,n){!async function(e,t){let n;for await(const i of e){const e=i.toString();n=n||o(e);const r=n||"\n",c=e.split(`${r}${r}`);for(const e of c)e.split(t.prefix).slice(1).forEach(e=>{a(e.trim(),t)})}}(await async function(e,t){switch(e){case"merge":return c({from:await s.raw("reflog",'--pretty=format:"%h"',"--no-patch","-1","HEAD@{1}").then(e=>e.replace(/"/g,""))});case"rewrite":return c({from:"origin",to:"HEAD"});case"checkout":const[o,n]=t;return c({from:o,to:n});case"since":return c({from:t[0]});default:throw new Error("[git-notify] unsupported git hook: "+e)}}(e,t),n)}(l.input[0],l.input.slice(1),l.flags);
//# sourceMappingURL=git-notify.cjs.production.min.js.map
;