@lntvow/dev 4.4.4 → 4.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.cjs CHANGED
@@ -32,5 +32,5 @@ Expecting one of '${n.join("', '")}'`);let s=`${t}Help`;return this.on(s,i=>{let
32
32
  `){return e.split(r).reduce((n,s)=>{let i=t?s.trim():s;return i&&n.push(i),n},[])}function Pr(e,t){return te(e,!0).map(r=>t(r))}function Ir(e){return(0,Se.exists)(e,Se.FOLDER)}function $(e,t){return Array.isArray(e)?e.includes(t)||e.push(t):e.add(t),t}function Cs(e,t){return Array.isArray(e)&&!e.includes(t)&&e.push(t),e}function Ae(e,t){if(Array.isArray(e)){let r=e.indexOf(t);r>=0&&e.splice(r,1)}else e.delete(t);return t}function yt(e){return Array.isArray(e)?e:[e]}function ws(e){return e.replace(/[\s-]+(.)/g,(t,r)=>r.toUpperCase())}function ks(e){return yt(e).map(String)}function L(e,t=0){if(e==null)return t;let r=parseInt(e,10);return isNaN(r)?t:r}function Kt(e,t){let r=[];for(let n=0,s=e.length;n<s;n++)r.push(t,e[n]);return r}function Qt(e){return(Array.isArray(e)?ds.Buffer.concat(e):e).toString("utf-8")}function Os(e,t){return Object.assign({},...t.map(r=>r in e?{[r]:e[r]}:{}))}function yr(e=0){return new Promise(t=>setTimeout(t,e))}function vr(e){if(e!==!1)return e}var Wt,It,ee,Ee=d({"src/lib/utils/util.ts"(){"use strict";Wt="\0",It=()=>{},ee=Object.prototype.toString.call.bind(Object.prototype.toString)}});function vt(e,t,r){return t(e)?e:arguments.length>2?r:void 0}function Cr(e,t){let r=Ce(e)?"string":typeof e;return/number|string|boolean/.test(r)&&(!t||!t.includes(r))}function $e(e){return!!e&&ee(e)==="[object Object]"}function Ts(e){return typeof e=="function"}var re,tt,xs,we,Lr,Ss=d({"src/lib/utils/argument-filters.ts"(){"use strict";Ee(),Zt(),re=e=>Array.isArray(e),tt=e=>typeof e=="string",xs=e=>Array.isArray(e)&&e.every(tt),we=e=>tt(e)||Array.isArray(e)&&e.every(tt),Lr=e=>e==null||"number|boolean|function".includes(typeof e)?!1:Array.isArray(e)||typeof e=="string"||typeof e.length=="number"}}),wr,Da=d({"src/lib/utils/exit-codes.ts"(){"use strict";wr=(e=>(e[e.SUCCESS=0]="SUCCESS",e[e.ERROR=1]="ERROR",e[e.NOT_FOUND=-2]="NOT_FOUND",e[e.UNCLEAN=128]="UNCLEAN",e))(wr||{})}}),ke,Pa=d({"src/lib/utils/git-output-streams.ts"(){"use strict";ke=class As{constructor(t,r){this.stdOut=t,this.stdErr=r}asStrings(){return new As(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}}),S,At,Ia=d({"src/lib/utils/line-parser.ts"(){"use strict";S=class{constructor(e,t){this.matches=[],this.parse=(r,n)=>(this.resetMatches(),this._regExp.every((s,i)=>this.addMatch(s,i,r(i)))?this.useMatches(n,this.prepareMatches())!==!1:!1),this._regExp=Array.isArray(e)?e:[e],t&&(this.useMatches=t)}useMatches(e,t){throw new Error("LineParser:useMatches not implemented")}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(e,t,r){let n=r&&e.exec(r);return n&&this.pushMatch(t,n),!!n}pushMatch(e,t){this.matches.push(...t.slice(1))}},At=class extends S{addMatch(e,t,r){return/^remote:\s/.test(String(r))&&super.addMatch(e,t,r)}pushMatch(e,t){(e>0||t.length>1)&&super.pushMatch(e,t)}}}});function Es(...e){let t=process.cwd(),r=Object.assign({baseDir:t,...$s},...e.filter(n=>typeof n=="object"&&n));return r.baseDir=r.baseDir||t,r.trimmed=r.trimmed===!0,r}var $s,La=d({"src/lib/utils/simple-git-options.ts"(){"use strict";$s={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function jr(e,t=[]){return $e(e)?Object.keys(e).reduce((r,n)=>{let s=e[n];if(Ce(s))r.push(s);else if(Cr(s,["boolean"]))r.push(n+"="+s);else if(Array.isArray(s))for(let i of s)Cr(i,["string","number"])||r.push(n+"="+i);else r.push(n);return r},t):t}function at(e,t=0,r=!1){let n=[];for(let s=0,i=t<0?e.length:t;s<i;s++)"string|number".includes(typeof e[s])&&n.push(String(e[s]));return jr(Nr(e),n),r||n.push(...ja(e)),n}function ja(e){let t=typeof Pt(e)=="function";return vt(Pt(e,t?1:0),re,[])}function Nr(e){let t=Ts(Pt(e));return vt(Pt(e,t?1:0),$e)}function G(e,t=!0){let r=gs(Pt(e));return t||_s(r)?r:void 0}var Na=d({"src/lib/utils/task-options.ts"(){"use strict";Ss(),Ee(),Zt()}});function kr(e,t){return e(t.stdOut,t.stdErr)}function ct(e,t,r,n=!0){return yt(r).forEach(s=>{for(let i=te(s,n),o=0,a=i.length;o<a;o++){let l=(h=0)=>{if(!(o+h>=a))return i[o+h]};t.some(({parse:h})=>h(l,e))}}),e}var Ha=d({"src/lib/utils/task-parser.ts"(){"use strict";Ee()}}),Rs={};W(Rs,{ExitCodes:()=>wr,GitOutputStreams:()=>ke,LineParser:()=>S,NOOP:()=>It,NULL:()=>Wt,RemoteLineParser:()=>At,append:()=>$,appendTaskOptions:()=>jr,asArray:()=>yt,asCamelCase:()=>ws,asFunction:()=>gs,asNumber:()=>L,asStringArray:()=>ks,bufferToString:()=>Qt,callTaskParser:()=>kr,createInstanceConfig:()=>Es,delay:()=>yr,filterArray:()=>re,filterFunction:()=>Ts,filterHasLength:()=>Lr,filterPlainObject:()=>$e,filterPrimitives:()=>Cr,filterString:()=>tt,filterStringArray:()=>xs,filterStringOrStringArray:()=>we,filterType:()=>vt,first:()=>ys,folderExists:()=>Ir,forEachLineWithContent:()=>Pr,getTrailingOptions:()=>at,including:()=>Cs,isUserFunction:()=>_s,last:()=>Pt,objectToString:()=>ee,orVoid:()=>vr,parseStringResponse:()=>ct,pick:()=>Os,prefixedArray:()=>Kt,remove:()=>Ae,splitOn:()=>bs,toLinesWithContent:()=>te,trailingFunctionArgument:()=>G,trailingOptionsArgument:()=>Nr});var O=d({"src/lib/utils/index.ts"(){"use strict";Ss(),Da(),Pa(),Ia(),La(),Na(),Ha(),Ee()}}),Fs={};W(Fs,{CheckRepoActions:()=>Or,checkIsBareRepoTask:()=>Ds,checkIsRepoRootTask:()=>Ms,checkIsRepoTask:()=>Ba});function Ba(e){switch(e){case"bare":return Ds();case"root":return Ms()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:Re,parser:Hr}}function Ms(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:Re,parser(t){return/^\.(git)?$/.test(t.trim())}}}function Ds(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:Re,parser:Hr}}function Ga(e){return/(Not a git repository|Kein Git-Repository)/i.test(String(e))}var Or,Re,Hr,Ps=d({"src/lib/tasks/check-is-repo.ts"(){"use strict";O(),Or=(e=>(e.BARE="bare",e.IN_TREE="tree",e.IS_REPO_ROOT="root",e))(Or||{}),Re=({exitCode:e},t,r,n)=>{if(e===128&&Ga(t))return r(Buffer.from("false"));n(t)},Hr=e=>e.trim()==="true"}});function Va(e,t){let r=new Is(e),n=e?js:Ls;return te(t).forEach(s=>{let i=s.replace(n,"");r.paths.push(i),(Ns.test(i)?r.folders:r.files).push(i)}),r}var Is,Ls,js,Ns,Wa=d({"src/lib/responses/CleanSummary.ts"(){"use strict";O(),Is=class{constructor(e){this.dryRun=e,this.paths=[],this.files=[],this.folders=[]}},Ls=/^[a-z]+\s*/i,js=/^[a-z]+\s+[a-z]+\s*/i,Ns=/\/$/}}),Tr={};W(Tr,{EMPTY_COMMANDS:()=>Fe,adhocExecTask:()=>Hs,configurationErrorTask:()=>ut,isBufferTask:()=>Gs,isEmptyTask:()=>Vs,straightThroughBufferTask:()=>Bs,straightThroughStringTask:()=>st});function Hs(e){return{commands:Fe,format:"empty",parser:e}}function ut(e){return{commands:Fe,format:"empty",parser(){throw typeof e=="string"?new ps(e):e}}}function st(e,t=!1){return{commands:e,format:"utf-8",parser(r){return t?String(r).trim():r}}}function Bs(e){return{commands:e,format:"buffer",parser(t){return t}}}function Gs(e){return e.format==="buffer"}function Vs(e){return e.format==="empty"||!e.commands.length}var Fe,V=d({"src/lib/tasks/task.ts"(){"use strict";ms(),Fe=[]}}),Ws={};W(Ws,{CONFIG_ERROR_INTERACTIVE_MODE:()=>Br,CONFIG_ERROR_MODE_REQUIRED:()=>Gr,CONFIG_ERROR_UNKNOWN_OPTION:()=>Vr,CleanOptions:()=>_e,cleanTask:()=>qs,cleanWithOptionsTask:()=>qa,isCleanOptionsArray:()=>Ua});function qa(e,t){let{cleanMode:r,options:n,valid:s}=za(e);return r?s.options?(n.push(...t),n.some(Ka)?ut(Br):qs(r,n)):ut(Vr+JSON.stringify(e)):ut(Gr)}function qs(e,t){return{commands:["clean",`-${e}`,...t],format:"utf-8",parser(n){return Va(e==="n",n)}}}function Ua(e){return Array.isArray(e)&&e.every(t=>Wr.has(t))}function za(e){let t,r=[],n={cleanMode:!1,options:!0};return e.replace(/[^a-z]i/g,"").split("").forEach(s=>{Ya(s)?(t=s,n.cleanMode=!0):n.options=n.options&&Ja(r[r.length]=`-${s}`)}),{cleanMode:t,options:r,valid:n}}function Ya(e){return e==="f"||e==="n"}function Ja(e){return/^-[a-z]$/i.test(e)&&Wr.has(e.charAt(1))}function Ka(e){return/^-[^\-]/.test(e)?e.indexOf("i")>0:e==="--interactive"}var Br,Gr,Vr,_e,Wr,Us=d({"src/lib/tasks/clean.ts"(){"use strict";Wa(),O(),V(),Br="Git clean interactive mode is not supported",Gr='Git clean mode parameter ("n" or "f") is required',Vr="Git clean unknown option found in: ",_e=(e=>(e.DRY_RUN="n",e.FORCE="f",e.IGNORED_INCLUDED="x",e.IGNORED_ONLY="X",e.EXCLUDING="e",e.QUIET="q",e.RECURSIVE="d",e))(_e||{}),Wr=new Set(["i",...ks(Object.values(_e))])}});function Qa(e){let t=new Ys;for(let r of zs(e))t.addValue(r.file,String(r.key),r.value);return t}function Za(e,t){let r=null,n=[],s=new Map;for(let i of zs(e,t))i.key===t&&(n.push(r=i.value),s.has(i.file)||s.set(i.file,[]),s.get(i.file).push(r));return{key:t,paths:Array.from(s.keys()),scopes:s,value:r,values:n}}function Xa(e){return e.replace(/^(file):/,"")}function*zs(e,t=null){let r=e.split("\0");for(let n=0,s=r.length-1;n<s;){let i=Xa(r[n++]),o=r[n++],a=t;if(o.includes(`
33
33
  `)){let l=bs(o,`
34
34
  `);a=l[0],o=l[1]}yield{file:i,key:a,value:o}}}var Ys,tu=d({"src/lib/responses/ConfigList.ts"(){"use strict";O(),Ys=class{constructor(){this.files=[],this.values=Object.create(null)}get all(){return this._all||(this._all=this.files.reduce((e,t)=>Object.assign(e,this.values[t]),{})),this._all}addFile(e){if(!(e in this.values)){let t=Pt(this.files);this.values[e]=t?Object.create(this.values[t]):{},this.files.push(e)}return this.values[e]}addValue(e,t,r){let n=this.addFile(e);n.hasOwnProperty(t)?Array.isArray(n[t])?n[t].push(r):n[t]=[n[t],r]:n[t]=r,this._all=void 0}}}});function pr(e,t){return typeof e=="string"&&xr.hasOwnProperty(e)?e:t}function eu(e,t,r,n){let s=["config",`--${n}`];return r&&s.push("--add"),s.push(e,t),{commands:s,format:"utf-8",parser(i){return i}}}function ru(e,t){let r=["config","--null","--show-origin","--get-all",e];return t&&r.splice(1,0,`--${t}`),{commands:r,format:"utf-8",parser(n){return Za(n,e)}}}function nu(e){let t=["config","--list","--show-origin","--null"];return e&&t.push(`--${e}`),{commands:t,format:"utf-8",parser(r){return Qa(r)}}}function su(){return{addConfig(e,t,...r){return this._runTask(eu(e,t,r[0]===!0,pr(r[1],"local")),G(arguments))},getConfig(e,t){return this._runTask(ru(e,pr(t,void 0)),G(arguments))},listConfig(...e){return this._runTask(nu(pr(e[0],void 0)),G(arguments))}}}var xr,Js=d({"src/lib/tasks/config.ts"(){"use strict";tu(),O(),xr=(e=>(e.system="system",e.global="global",e.local="local",e.worktree="worktree",e))(xr||{})}});function iu(e){return Ks.has(e)}var mr,Ks,Qs=d({"src/lib/tasks/diff-name-status.ts"(){"use strict";mr=(e=>(e.ADDED="A",e.COPIED="C",e.DELETED="D",e.MODIFIED="M",e.RENAMED="R",e.CHANGED="T",e.UNMERGED="U",e.UNKNOWN="X",e.BROKEN="B",e))(mr||{}),Ks=new Set(Object.values(mr))}});function ou(...e){return new Xs().param(...e)}function au(e){let t=new Set,r={};return Pr(e,n=>{let[s,i,o]=n.split(Wt);t.add(s),(r[s]=r[s]||[]).push({line:L(i),path:s,preview:o})}),{paths:t,results:r}}function uu(){return{grep(e){let t=G(arguments),r=at(arguments);for(let s of Zs)if(r.includes(s))return this._runTask(ut(`git.grep: use of "${s}" is not supported.`),t);typeof e=="string"&&(e=ou().param(e));let n=["grep","--null","-n","--full-name",...r,...e];return this._runTask({commands:n,format:"utf-8",parser(s){return au(s)}},t)}}}var Zs,Jt,Ln,Xs,ti=d({"src/lib/tasks/grep.ts"(){"use strict";O(),V(),Zs=["-h"],Jt=Symbol("grepQuery"),Xs=class{constructor(){this[Ln]=[]}*[(Ln=Jt,Symbol.iterator)](){for(let e of this[Jt])yield e}and(...e){return e.length&&this[Jt].push("--and","(",...Kt(e,"-e"),")"),this}param(...e){return this[Jt].push(...Kt(e,"-e")),this}}}}),ei={};W(ei,{ResetMode:()=>be,getResetMode:()=>lu,resetTask:()=>cu});function cu(e,t){let r=["reset"];return ri(e)&&r.push(`--${e}`),r.push(...t),st(r)}function lu(e){if(ri(e))return e;switch(typeof e){case"string":case"undefined":return"soft"}}function ri(e){return ni.includes(e)}var be,ni,si=d({"src/lib/tasks/reset.ts"(){"use strict";V(),be=(e=>(e.MIXED="mixed",e.SOFT="soft",e.HARD="hard",e.MERGE="merge",e.KEEP="keep",e))(be||{}),ni=Array.from(Object.values(be))}});function hu(){return(0,Oe.default)("simple-git")}function jn(e,t,r){return!t||!String(t).replace(/\s*/,"")?r?(n,...s)=>{e(n,...s),r(n,...s)}:e:(n,...s)=>{e(`%s ${n}`,t,...s),r&&r(n,...s)}}function fu(e,t,{namespace:r}){if(typeof e=="string")return e;let n=t&&t.namespace||"";return n.startsWith(r)?n.substr(r.length+1):n||r}function qr(e,t,r,n=hu()){let s=e&&`[${e}]`||"",i=[],o=typeof t=="string"?n.extend(t):t,a=fu(vt(t,tt),o,n);return h(r);function l(u,c){return $(i,qr(e,a.replace(/^[^:]+/,u),c,n))}function h(u){let c=u&&`[${u}]`||"",f=o&&jn(o,c)||It,p=jn(n,`${s} ${c}`,f);return Object.assign(o?f:p,{label:e,sibling:l,info:p,step:h})}}var ii=d({"src/lib/git-logger.ts"(){"use strict";O(),Oe.default.formatters.L=e=>String(Lr(e)?e.length:"-"),Oe.default.formatters.B=e=>Buffer.isBuffer(e)?e.toString("utf8"):ee(e)}}),oi,pu=d({"src/lib/runners/tasks-pending-queue.ts"(){"use strict";Et(),ii(),oi=class Sr{constructor(t="GitExecutor"){this.logLabel=t,this._queue=new Map}withProgress(t){return this._queue.get(t)}createProgress(t){let r=Sr.getName(t.commands[0]),n=qr(this.logLabel,r);return{task:t,logger:n,name:r}}push(t){let r=this.createProgress(t);return r.logger("Adding task to the queue, commands = %o",t.commands),this._queue.set(t,r),r}fatal(t){for(let[r,{logger:n}]of Array.from(this._queue.entries()))r===t.task?(n.info("Failed %o",t),n("Fatal exception, any as-yet un-started tasks run through this executor will not be attempted")):n.info("A fatal exception occurred in a previous task, the queue has been purged: %o",t.message),this.complete(r);if(this._queue.size!==0)throw new Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(t){this.withProgress(t)&&this._queue.delete(t)}attempt(t){let r=this.withProgress(t);if(!r)throw new xt(void 0,"TasksPendingQueue: attempt called for an unknown task");return r.logger("Starting task"),r}static getName(t="empty"){return`task:${t}:${++Sr.counter}`}static{this.counter=0}}}});function Dt(e,t){return{method:ys(e.commands)||"",commands:t}}function mu(e,t){return r=>{t("[ERROR] child process exception %o",r),e.push(Buffer.from(String(r.stack),"ascii"))}}function Nn(e,t,r,n){return s=>{r("%s received %L bytes",t,s),n("%B",s),e.push(s)}}var Ar,du=d({"src/lib/runners/git-executor-chain.ts"(){"use strict";Et(),V(),O(),pu(),Ar=class{constructor(e,t,r){this._executor=e,this._scheduler=t,this._plugins=r,this._chain=Promise.resolve(),this._queue=new oi}get cwd(){return this._cwd||this._executor.cwd}set cwd(e){this._cwd=e}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(e){return this._queue.push(e),this._chain=this._chain.then(()=>this.attemptTask(e))}async attemptTask(e){let t=await this._scheduler.next(),r=()=>this._queue.complete(e);try{let{logger:n}=this._queue.attempt(e);return await(Vs(e)?this.attemptEmptyTask(e,n):this.attemptRemoteTask(e,n))}catch(n){throw this.onFatalException(e,n)}finally{r(),t()}}onFatalException(e,t){let r=t instanceof xt?Object.assign(t,{task:e}):new xt(e,t&&String(t));return this._chain=Promise.resolve(),this._queue.fatal(r),r}async attemptRemoteTask(e,t){let r=this._plugins.exec("spawn.binary","",Dt(e,e.commands)),n=this._plugins.exec("spawn.args",[...e.commands],Dt(e,e.commands)),s=await this.gitResponse(e,r,n,this.outputHandler,t.step("SPAWN")),i=await this.handleTaskData(e,n,s,t.step("HANDLE"));return t("passing response to task's parser as a %s",e.format),Gs(e)?kr(e.parser,i):kr(e.parser,i.asStrings())}async attemptEmptyTask(e,t){return t("empty task bypassing child process to call to task's parser"),e.parser(this)}handleTaskData(e,t,r,n){let{exitCode:s,rejection:i,stdOut:o,stdErr:a}=r;return new Promise((l,h)=>{n("Preparing to handle process response exitCode=%d stdOut=",s);let{error:u}=this._plugins.exec("task.error",{error:i},{...Dt(e,t),...r});if(u&&e.onError)return n.info("exitCode=%s handling with custom error handler"),e.onError(r,u,c=>{n.info("custom error handler treated as success"),n("custom error returned a %s",ee(c)),l(new ke(Array.isArray(c)?Buffer.concat(c):c,Buffer.concat(a)))},h);if(u)return n.info("handling as error: exitCode=%s stdErr=%s rejection=%o",s,a.length,i),h(u);n.info("retrieving task output complete"),l(new ke(Buffer.concat(o),Buffer.concat(a)))})}async gitResponse(e,t,r,n,s){let i=s.sibling("output"),o=this._plugins.exec("spawn.options",{cwd:this.cwd,env:this.env,windowsHide:!0},Dt(e,e.commands));return new Promise(a=>{let l=[],h=[];s.info("%s %o",t,r),s("%O",o);let u=this._beforeSpawn(e,r);if(u)return a({stdOut:l,stdErr:h,exitCode:9901,rejection:u});this._plugins.exec("spawn.before",void 0,{...Dt(e,r),kill(f){u=f||u}});let c=(0,ai.spawn)(t,r,o);c.stdout.on("data",Nn(l,"stdOut",s,i.step("stdOut"))),c.stderr.on("data",Nn(h,"stdErr",s,i.step("stdErr"))),c.on("error",mu(h,s)),n&&(s("Passing child process stdOut/stdErr to custom outputHandler"),n(t,c.stdout,c.stderr,[...r])),this._plugins.exec("spawn.after",void 0,{...Dt(e,r),spawned:c,close(f,p){a({stdOut:l,stdErr:h,exitCode:f,rejection:u||p})},kill(f){c.killed||(u=f,c.kill("SIGINT"))}})})}_beforeSpawn(e,t){let r;return this._plugins.exec("spawn.before",void 0,{...Dt(e,t),kill(n){r=n||r}}),r}}}}),ui={};W(ui,{GitExecutor:()=>ci});var ci,gu=d({"src/lib/runners/git-executor.ts"(){"use strict";du(),ci=class{constructor(e,t,r){this.cwd=e,this._scheduler=t,this._plugins=r,this._chain=new Ar(this,this._scheduler,this._plugins)}chain(){return new Ar(this,this._scheduler,this._plugins)}push(e){return this._chain.push(e)}}}});function _u(e,t,r=It){let n=i=>{r(null,i)},s=i=>{i?.task===e&&r(i instanceof Xt?bu(i):i,void 0)};t.then(n,s)}function bu(e){let t=n=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${n} should be GitResponseError.git.${n}, this will no longer be available in version 3`),t=It};return Object.create(e,Object.getOwnPropertyNames(e.git).reduce(r,{}));function r(n,s){return s in e||(n[s]={enumerable:!1,configurable:!1,get(){return t(s),e.git[s]}}),n}}var yu=d({"src/lib/task-callback.ts"(){"use strict";qt(),O()}});function Hn(e,t){return Hs(r=>{if(!Ir(e))throw new Error(`Git.cwd: cannot change to non-directory "${e}"`);return(t||r).cwd=e})}var vu=d({"src/lib/tasks/change-working-directory.ts"(){"use strict";O(),V()}});function dr(e){let t=["checkout",...e];return t[1]==="-b"&&t.includes("-B")&&(t[1]=Ae(t,"-B")),st(t)}function Cu(){return{checkout(){return this._runTask(dr(at(arguments,1)),G(arguments))},checkoutBranch(e,t){return this._runTask(dr(["-b",e,t,...at(arguments)]),G(arguments))},checkoutLocalBranch(e){return this._runTask(dr(["-b",e,...at(arguments)]),G(arguments))}}}var wu=d({"src/lib/tasks/checkout.ts"(){"use strict";O(),V()}});function ku(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}function Ou(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser(e){return ct(ku(),[li],e)}})}}}var li,Tu=d({"src/lib/tasks/count-objects.ts"(){"use strict";O(),li=new S(/([a-z-]+): (\d+)$/,(e,[t,r])=>{let n=ws(t);e.hasOwnProperty(n)&&(e[n]=L(r))})}});function xu(e){return ct({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},hi,e)}var hi,Su=d({"src/lib/parsers/parse-commit.ts"(){"use strict";O(),hi=[new S(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(e,[t,r,n])=>{e.branch=t,e.commit=n,e.root=!!r}),new S(/\s*Author:\s(.+)/i,(e,[t])=>{let r=t.split("<"),n=r.pop();!n||!n.includes("@")||(e.author={email:n.substr(0,n.length-1),name:r.join("<").trim()})}),new S(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(e,[t,r,n])=>{e.summary.changes=parseInt(t,10)||0,e.summary.insertions=parseInt(r,10)||0,e.summary.deletions=parseInt(n,10)||0}),new S(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(e,[t,r,n])=>{e.summary.changes=parseInt(t,10)||0;let s=parseInt(r,10)||0;n==="-"?e.summary.deletions=s:n==="+"&&(e.summary.insertions=s)})]}});function Au(e,t,r){return{commands:["-c","core.abbrev=40","commit",...Kt(e,"-m"),...t,...r],format:"utf-8",parser:xu}}function Eu(){return{commit(t,...r){let n=G(arguments),s=e(t)||Au(yt(t),yt(vt(r[0],we,[])),[...vt(r[1],re,[]),...at(arguments,0,!0)]);return this._runTask(s,n)}};function e(t){return!we(t)&&ut("git.commit: requires the commit message to be supplied as a string/string[]")}}var $u=d({"src/lib/tasks/commit.ts"(){"use strict";Su(),O(),V()}});function Ru(){return{firstCommit(){return this._runTask(st(["rev-list","--max-parents=0","HEAD"],!0),G(arguments))}}}var Fu=d({"src/lib/tasks/first-commit.ts"(){"use strict";O(),V()}});function Mu(e,t){let r=["hash-object",e];return t&&r.push("-w"),st(r,!0)}var Du=d({"src/lib/tasks/hash-object.ts"(){"use strict";V()}});function Pu(e,t,r){let n=String(r).trim(),s;if(s=fi.exec(n))return new ye(e,t,!1,s[1]);if(s=pi.exec(n))return new ye(e,t,!0,s[1]);let i="",o=n.split(" ");for(;o.length;)if(o.shift()==="in"){i=o.join(" ");break}return new ye(e,t,/^re/i.test(n),i)}var ye,fi,pi,Iu=d({"src/lib/responses/InitSummary.ts"(){"use strict";ye=class{constructor(e,t,r,n){this.bare=e,this.path=t,this.existing=r,this.gitDir=n}},fi=/^Init.+ repository in (.+)$/,pi=/^Rein.+ in (.+)$/}});function Lu(e){return e.includes(Ur)}function ju(e=!1,t,r){let n=["init",...r];return e&&!Lu(n)&&n.splice(1,0,Ur),{commands:n,format:"utf-8",parser(s){return Pu(n.includes("--bare"),t,s)}}}var Ur,Nu=d({"src/lib/tasks/init.ts"(){"use strict";Iu(),Ur="--bare"}});function zr(e){for(let t=0;t<e.length;t++){let r=Yr.exec(e[t]);if(r)return`--${r[1]}`}return""}function Hu(e){return Yr.test(e)}var Yr,ne=d({"src/lib/args/log-format.ts"(){"use strict";Yr=/^--(stat|numstat|name-only|name-status)(=|$)/}}),mi,Bu=d({"src/lib/responses/DiffSummary.ts"(){"use strict";mi=class{constructor(){this.changed=0,this.deletions=0,this.insertions=0,this.files=[]}}}});function di(e=""){let t=gi[e];return r=>ct(new mi,t,r,!1)}var gr,Bn,Gn,Vn,gi,_i=d({"src/lib/parsers/parse-diff-summary.ts"(){"use strict";ne(),Bu(),Qs(),O(),gr=[new S(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(e,[t,r,n=""])=>{e.files.push({file:t.trim(),changes:L(r),insertions:n.replace(/[^+]/g,"").length,deletions:n.replace(/[^-]/g,"").length,binary:!1})}),new S(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(e,[t,r,n])=>{e.files.push({file:t.trim(),before:L(r),after:L(n),binary:!0})}),new S(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(e,[t,r])=>{let n=/(\d+) i/.exec(r),s=/(\d+) d/.exec(r);e.changed=L(t),e.insertions=L(n?.[1]),e.deletions=L(s?.[1])})],Bn=[new S(/(\d+)\t(\d+)\t(.+)$/,(e,[t,r,n])=>{let s=L(t),i=L(r);e.changed++,e.insertions+=s,e.deletions+=i,e.files.push({file:n,changes:s+i,insertions:s,deletions:i,binary:!1})}),new S(/-\t-\t(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,after:0,before:0,binary:!0})})],Gn=[new S(/(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,changes:0,insertions:0,deletions:0,binary:!1})})],Vn=[new S(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(e,[t,r,n,s,i])=>{e.changed++,e.files.push({file:i??n,changes:0,insertions:0,deletions:0,binary:!1,status:vr(iu(t)&&t),from:vr(!!i&&n!==i&&n),similarity:L(r)})})],gi={"":gr,"--stat":gr,"--numstat":Bn,"--name-status":Vn,"--name-only":Gn}}});function Gu(e,t){return t.reduce((r,n,s)=>(r[n]=e[s]||"",r),Object.create({diff:null}))}function bi(e=Qr,t=yi,r=""){let n=di(r);return function(s){let i=te(s.trim(),!1,Jr).map(function(o){let a=o.split(Kr),l=Gu(a[0].split(e),t);return a.length>1&&a[1].trim()&&(l.diff=n(a[1])),l});return{all:i,latest:i.length&&i[0]||null,total:i.length}}}var Jr,Kr,Qr,yi,vi=d({"src/lib/parsers/parse-list-log-summary.ts"(){"use strict";O(),_i(),ne(),Jr="\xF2\xF2\xF2\xF2\xF2\xF2 ",Kr=" \xF2\xF2",Qr=" \xF2 ",yi=["hash","date","message","refs","author_name","author_email"]}}),Ci={};W(Ci,{diffSummaryTask:()=>Vu,validateLogFormatConfig:()=>Me});function Vu(e){let t=zr(e),r=["diff"];return t===""&&(t="--stat",r.push("--stat=4096")),r.push(...e),Me(r)||{commands:r,format:"utf-8",parser:di(t)}}function Me(e){let t=e.filter(Hu);if(t.length>1)return ut(`Summary flags are mutually exclusive - pick one of ${t.join(",")}`);if(t.length&&e.includes("-z"))return ut(`Summary flag ${t} parsing is not compatible with null termination option '-z'`)}var Zr=d({"src/lib/tasks/diff.ts"(){"use strict";ne(),_i(),V()}});function Wu(e,t){let r=[],n=[];return Object.keys(e).forEach(s=>{r.push(s),n.push(String(e[s]))}),[r,n.join(t)]}function qu(e){return Object.keys(e).reduce((t,r)=>(r in Er||(t[r]=e[r]),t),{})}function wi(e={},t=[]){let r=vt(e.splitter,tt,Qr),n=$e(e.format)?e.format:{hash:"%H",date:e.strictDate===!1?"%ai":"%aI",message:"%s",refs:"%D",body:e.multiLine?"%B":"%b",author_name:e.mailMap!==!1?"%aN":"%an",author_email:e.mailMap!==!1?"%aE":"%ae"},[s,i]=Wu(n,r),o=[],a=[`--pretty=format:${Jr}${i}${Kr}`,...t],l=e.n||e["max-count"]||e.maxCount;if(l&&a.push(`--max-count=${l}`),e.from||e.to){let h=e.symmetric!==!1?"...":"..";o.push(`${e.from||""}${h}${e.to||""}`)}return tt(e.file)&&a.push("--follow",Ma(e.file)),jr(qu(e),a),{fields:s,splitter:r,commands:[...a,...o]}}function Uu(e,t,r){let n=bi(e,t,zr(r));return{commands:["log",...r],format:"utf-8",parser:n}}function zu(){return{log(...r){let n=G(arguments),s=wi(Nr(arguments),vt(arguments[0],re)),i=t(...r)||Me(s.commands)||e(s);return this._runTask(i,n)}};function e(r){return Uu(r.splitter,r.fields,r.commands)}function t(r,n){return tt(r)&&tt(n)&&ut("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}}var Er,ki=d({"src/lib/tasks/log.ts"(){"use strict";ne(),Zt(),vi(),O(),V(),Zr(),Er=(e=>(e[e["--pretty"]=0]="--pretty",e[e["max-count"]=1]="max-count",e[e.maxCount=2]="maxCount",e[e.n=3]="n",e[e.file=4]="file",e[e.format=5]="format",e[e.from=6]="from",e[e.to=7]="to",e[e.splitter=8]="splitter",e[e.symmetric=9]="symmetric",e[e.mailMap=10]="mailMap",e[e.multiLine=11]="multiLine",e[e.strictDate=12]="strictDate",e))(Er||{})}}),ve,Oi,Yu=d({"src/lib/responses/MergeSummary.ts"(){"use strict";ve=class{constructor(e,t=null,r){this.reason=e,this.file=t,this.meta=r}toString(){return`${this.file}:${this.reason}`}},Oi=class{constructor(){this.conflicts=[],this.merges=[],this.result="success"}get failed(){return this.conflicts.length>0}get reason(){return this.result}toString(){return this.conflicts.length?`CONFLICTS: ${this.conflicts.join(", ")}`:"OK"}}}}),$r,Ti,Ju=d({"src/lib/responses/PullSummary.ts"(){"use strict";$r=class{constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},Ti=class{constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function _r(e){return e.objects=e.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}function Wn(e){let t=/^\s*(\d+)/.exec(e),r=/delta (\d+)/i.exec(e);return{count:L(t&&t[1]||"0"),delta:L(r&&r[1]||"0")}}var xi,Ku=d({"src/lib/parsers/parse-remote-objects.ts"(){"use strict";O(),xi=[new At(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(e,[t,r])=>{let n=t.toLowerCase(),s=_r(e.remoteMessages);Object.assign(s,{[n]:L(r)})}),new At(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(e,[t,r])=>{let n=t.toLowerCase(),s=_r(e.remoteMessages);Object.assign(s,{[n]:L(r)})}),new At(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(e,[t,r,n])=>{let s=_r(e.remoteMessages);s.total=Wn(t),s.reused=Wn(r),s.packReused=L(n)})]}});function Si(e,t){return ct({remoteMessages:new Ei},Ai,t)}var Ai,Ei,$i=d({"src/lib/parsers/parse-remote-messages.ts"(){"use strict";O(),Ku(),Ai=[new At(/^remote:\s*(.+)$/,(e,[t])=>(e.remoteMessages.all.push(t.trim()),!1)),...xi,new At([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(e,[t])=>{e.remoteMessages.pullRequestUrl=t}),new At([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(e,[t,r,n])=>{e.remoteMessages.vulnerabilities={count:L(t),summary:r,url:n}})],Ei=class{constructor(){this.all=[]}}}});function Qu(e,t){let r=ct(new Ti,Ri,[e,t]);return r.message&&r}var qn,Un,zn,Yn,Ri,Jn,Xr,Fi=d({"src/lib/parsers/parse-pull.ts"(){"use strict";Ju(),O(),$i(),qn=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,Un=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,zn=/^(create|delete) mode \d+ (.+)/,Yn=[new S(qn,(e,[t,r,n])=>{e.files.push(t),r&&(e.insertions[t]=r.length),n&&(e.deletions[t]=n.length)}),new S(Un,(e,[t,,r,,n])=>r!==void 0||n!==void 0?(e.summary.changes=+t||0,e.summary.insertions=+r||0,e.summary.deletions=+n||0,!0):!1),new S(zn,(e,[t,r])=>{$(e.files,r),$(t==="create"?e.created:e.deleted,r)})],Ri=[new S(/^from\s(.+)$/i,(e,[t])=>void(e.remote=t)),new S(/^fatal:\s(.+)$/,(e,[t])=>void(e.message=t)),new S(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(e,[t,r,n,s])=>{e.branch.local=n,e.hash.local=t,e.branch.remote=s,e.hash.remote=r})],Jn=(e,t)=>ct(new $r,Yn,[e,t]),Xr=(e,t)=>Object.assign(new $r,Jn(e,t),Si(e,t))}}),Kn,Mi,Qn,Zu=d({"src/lib/parsers/parse-merge.ts"(){"use strict";Yu(),O(),Fi(),Kn=[new S(/^Auto-merging\s+(.+)$/,(e,[t])=>{e.merges.push(t)}),new S(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(e,[t,r])=>{e.conflicts.push(new ve(t,r))}),new S(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(e,[t,r,n])=>{e.conflicts.push(new ve(t,r,{deleteRef:n}))}),new S(/^CONFLICT\s+\((.+)\):/,(e,[t])=>{e.conflicts.push(new ve(t,null))}),new S(/^Automatic merge failed;\s+(.+)$/,(e,[t])=>{e.result=t})],Mi=(e,t)=>Object.assign(Qn(e,t),Xr(e,t)),Qn=e=>ct(new Oi,Kn,e)}});function Zn(e){return e.length?{commands:["merge",...e],format:"utf-8",parser(t,r){let n=Mi(t,r);if(n.failed)throw new Xt(n);return n}}:ut("Git.merge requires at least one option")}var Xu=d({"src/lib/tasks/merge.ts"(){"use strict";qt(),Zu(),V()}});function tc(e,t,r){let n=r.includes("deleted"),s=r.includes("tag")||/^refs\/tags/.test(e),i=!r.includes("new");return{deleted:n,tag:s,branch:!s,new:!i,alreadyUpdated:i,local:e,remote:t}}var Xn,Di,ts,ec=d({"src/lib/parsers/parse-push.ts"(){"use strict";O(),$i(),Xn=[new S(/^Pushing to (.+)$/,(e,[t])=>{e.repo=t}),new S(/^updating local tracking ref '(.+)'/,(e,[t])=>{e.ref={...e.ref||{},local:t}}),new S(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(e,[t,r,n])=>{e.pushed.push(tc(t,r,n))}),new S(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(e,[t,r,n])=>{e.branch={...e.branch||{},local:t,remote:r,remoteName:n}}),new S(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(e,[t,r,n,s])=>{e.update={head:{local:t,remote:r},hash:{from:n,to:s}}})],Di=(e,t)=>{let r=ts(e,t),n=Si(e,t);return{...r,...n}},ts=(e,t)=>ct({pushed:[]},Xn,[e,t])}}),Pi={};W(Pi,{pushTagsTask:()=>rc,pushTask:()=>tn});function rc(e={},t){return $(t,"--tags"),tn(e,t)}function tn(e={},t){let r=["push",...t];return e.branch&&r.splice(1,0,e.branch),e.remote&&r.splice(1,0,e.remote),Ae(r,"-v"),$(r,"--verbose"),$(r,"--porcelain"),{commands:r,format:"utf-8",parser:Di}}var Ii=d({"src/lib/tasks/push.ts"(){"use strict";ec(),O()}});function nc(){return{showBuffer(){let e=["show",...at(arguments,1)];return e.includes("--binary")||e.splice(1,0,"--binary"),this._runTask(Bs(e),G(arguments))},show(){let e=["show",...at(arguments,1)];return this._runTask(st(e),G(arguments))}}}var sc=d({"src/lib/tasks/show.ts"(){"use strict";O(),V()}}),es,Li,ic=d({"src/lib/responses/FileStatusSummary.ts"(){"use strict";es=/^(.+)\0(.+)$/,Li=class{constructor(e,t,r){if(this.path=e,this.index=t,this.working_dir=r,t==="R"||r==="R"){let n=es.exec(e)||[null,e,e];this.from=n[2]||"",this.path=n[1]||""}}}}});function rs(e){let[t,r]=e.split(Wt);return{from:r||t,to:t}}function ft(e,t,r){return[`${e}${t}`,r]}function br(e,...t){return t.map(r=>ft(e,r,(n,s)=>$(n.conflicted,s)))}function oc(e,t){let r=t.trim();switch(" "){case r.charAt(2):return n(r.charAt(0),r.charAt(1),r.substr(3));case r.charAt(1):return n(" ",r.charAt(0),r.substr(2));default:return}function n(s,i,o){let a=`${s}${i}`,l=ji.get(a);l&&l(e,o),a!=="##"&&a!=="!!"&&e.files.push(new Li(o,s,i))}}var ns,ji,Ni,ac=d({"src/lib/responses/StatusSummary.ts"(){"use strict";O(),ic(),ns=class{constructor(){this.not_added=[],this.conflicted=[],this.created=[],this.deleted=[],this.ignored=void 0,this.modified=[],this.renamed=[],this.files=[],this.staged=[],this.ahead=0,this.behind=0,this.current=null,this.tracking=null,this.detached=!1,this.isClean=()=>!this.files.length}},ji=new Map([ft(" ","A",(e,t)=>$(e.created,t)),ft(" ","D",(e,t)=>$(e.deleted,t)),ft(" ","M",(e,t)=>$(e.modified,t)),ft("A"," ",(e,t)=>$(e.created,t)&&$(e.staged,t)),ft("A","M",(e,t)=>$(e.created,t)&&$(e.staged,t)&&$(e.modified,t)),ft("D"," ",(e,t)=>$(e.deleted,t)&&$(e.staged,t)),ft("M"," ",(e,t)=>$(e.modified,t)&&$(e.staged,t)),ft("M","M",(e,t)=>$(e.modified,t)&&$(e.staged,t)),ft("R"," ",(e,t)=>{$(e.renamed,rs(t))}),ft("R","M",(e,t)=>{let r=rs(t);$(e.renamed,r),$(e.modified,r.to)}),ft("!","!",(e,t)=>{$(e.ignored=e.ignored||[],t)}),ft("?","?",(e,t)=>$(e.not_added,t)),...br("A","A","U"),...br("D","D","U"),...br("U","A","D","U"),["##",(e,t)=>{let r=/ahead (\d+)/,n=/behind (\d+)/,s=/^(.+?(?=(?:\.{3}|\s|$)))/,i=/\.{3}(\S*)/,o=/\son\s([\S]+)$/,a;a=r.exec(t),e.ahead=a&&+a[1]||0,a=n.exec(t),e.behind=a&&+a[1]||0,a=s.exec(t),e.current=a&&a[1],a=i.exec(t),e.tracking=a&&a[1],a=o.exec(t),e.current=a&&a[1]||e.current,e.detached=/\(no branch\)/.test(t)}]]),Ni=function(e){let t=e.split(Wt),r=new ns;for(let n=0,s=t.length;n<s;){let i=t[n++].trim();i&&(i.charAt(0)==="R"&&(i+=Wt+(t[n++]||"")),oc(r,i))}return r}}});function uc(e){return{format:"utf-8",commands:["status","--porcelain","-b","-u","--null",...e.filter(r=>!Hi.includes(r))],parser(r){return Ni(r)}}}var Hi,cc=d({"src/lib/tasks/status.ts"(){"use strict";ac(),Hi=["--null","-z"]}});function Te(e=0,t=0,r=0,n="",s=!0){return Object.defineProperty({major:e,minor:t,patch:r,agent:n,installed:s},"toString",{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}function lc(){return Te(0,0,0,"",!1)}function hc(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:fc,onError(e,t,r,n){if(e.exitCode===-2)return r(Buffer.from(en));n(t)}})}}}function fc(e){return e===en?lc():ct(Te(0,0,0,e),Bi,e)}var en,Bi,pc=d({"src/lib/tasks/version.ts"(){"use strict";O(),en="installed=false",Bi=[new S(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(e,[t,r,n,s=""])=>{Object.assign(e,Te(L(t),L(r),L(n),s))}),new S(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(e,[t,r,n,s=""])=>{Object.assign(e,Te(L(t),L(r),n,s))})]}}),Gi={};W(Gi,{SimpleGitApi:()=>Rr});var Rr,mc=d({"src/lib/simple-git-api.ts"(){"use strict";yu(),vu(),wu(),Tu(),$u(),Js(),Fu(),ti(),Du(),Nu(),ki(),Xu(),Ii(),sc(),cc(),V(),pc(),O(),Rr=class{constructor(e){this._executor=e}_runTask(e,t){let r=this._executor.chain(),n=r.push(e);return t&&_u(e,n,t),Object.create(this,{then:{value:n.then.bind(n)},catch:{value:n.catch.bind(n)},_executor:{value:r}})}add(e){return this._runTask(st(["add",...yt(e)]),G(arguments))}cwd(e){let t=G(arguments);return typeof e=="string"?this._runTask(Hn(e,this._executor),t):typeof e?.path=="string"?this._runTask(Hn(e.path,e.root&&this._executor||void 0),t):this._runTask(ut("Git.cwd: workingDirectory must be supplied as a string"),t)}hashObject(e,t){return this._runTask(Mu(e,t===!0),G(arguments))}init(e){return this._runTask(ju(e===!0,this._executor.cwd,at(arguments)),G(arguments))}merge(){return this._runTask(Zn(at(arguments)),G(arguments))}mergeFromTo(e,t){return tt(e)&&tt(t)?this._runTask(Zn([e,t,...at(arguments)]),G(arguments,!1)):this._runTask(ut("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"))}outputHandler(e){return this._executor.outputHandler=e,this}push(){let e=tn({remote:vt(arguments[0],tt),branch:vt(arguments[1],tt)},at(arguments));return this._runTask(e,G(arguments))}stash(){return this._runTask(st(["stash",...at(arguments)]),G(arguments))}status(){return this._runTask(uc(at(arguments)),G(arguments))}},Object.assign(Rr.prototype,Cu(),Eu(),su(),Ou(),Ru(),uu(),zu(),nc(),hc())}}),Vi={};W(Vi,{Scheduler:()=>qi});var ss,qi,dc=d({"src/lib/runners/scheduler.ts"(){"use strict";O(),ii(),ss=(()=>{let e=0;return()=>{e++;let{promise:t,done:r}=(0,Wi.createDeferred)();return{promise:t,done:r,id:e}}})(),qi=class{constructor(e=2){this.concurrency=e,this.logger=qr("","scheduler"),this.pending=[],this.running=[],this.logger("Constructed, concurrency=%s",e)}schedule(){if(!this.pending.length||this.running.length>=this.concurrency){this.logger("Schedule attempt ignored, pending=%s running=%s concurrency=%s",this.pending.length,this.running.length,this.concurrency);return}let e=$(this.running,this.pending.shift());this.logger("Attempting id=%s",e.id),e.done(()=>{this.logger("Completing id=",e.id),Ae(this.running,e),this.schedule()})}next(){let{promise:e,id:t}=$(this.pending,ss());return this.logger("Scheduling id=%s",t),this.schedule(),e}}}}),Ui={};W(Ui,{applyPatchTask:()=>gc});function gc(e,t){return st(["apply",...t,...e])}var _c=d({"src/lib/tasks/apply-patch.ts"(){"use strict";V()}});function bc(e,t){return{branch:e,hash:t,success:!0}}function yc(e){return{branch:e,hash:null,success:!1}}var zi,vc=d({"src/lib/responses/BranchDeleteSummary.ts"(){"use strict";zi=class{constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function Yi(e,t){return t===1&&Fr.test(e)}var is,Fr,os,De,Cc=d({"src/lib/parsers/parse-branch-delete.ts"(){"use strict";vc(),O(),is=/(\S+)\s+\(\S+\s([^)]+)\)/,Fr=/^error[^']+'([^']+)'/m,os=[new S(is,(e,[t,r])=>{let n=bc(t,r);e.all.push(n),e.branches[t]=n}),new S(Fr,(e,[t])=>{let r=yc(t);e.errors.push(r),e.all.push(r),e.branches[t]=r})],De=(e,t)=>ct(new zi,os,[e,t])}}),Ji,wc=d({"src/lib/responses/BranchSummary.ts"(){"use strict";Ji=class{constructor(){this.all=[],this.branches={},this.current="",this.detached=!1}push(e,t,r,n,s){e==="*"&&(this.detached=t,this.current=r),this.all.push(r),this.branches[r]={current:e==="*",linkedWorkTree:e==="+",name:r,commit:n,label:s}}}}});function as(e){return e?e.charAt(0):""}function Ki(e){return ct(new Ji,Qi,e)}var Qi,kc=d({"src/lib/parsers/parse-branch.ts"(){"use strict";wc(),O(),Qi=[new S(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(e,[t,r,n,s])=>{e.push(as(t),!0,r,n,s)}),new S(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,(e,[t,r,n,s])=>{e.push(as(t),!1,r,n,s)})]}}),Zi={};W(Zi,{branchLocalTask:()=>Tc,branchTask:()=>Oc,containsDeleteBranchCommand:()=>Xi,deleteBranchTask:()=>Sc,deleteBranchesTask:()=>xc});function Xi(e){let t=["-d","-D","--delete"];return e.some(r=>t.includes(r))}function Oc(e){let t=Xi(e),r=["branch",...e];return r.length===1&&r.push("-a"),r.includes("-v")||r.splice(1,0,"-v"),{format:"utf-8",commands:r,parser(n,s){return t?De(n,s).all[0]:Ki(n)}}}function Tc(){return{format:"utf-8",commands:["branch","-v"],parser:Ki}}function xc(e,t=!1){return{format:"utf-8",commands:["branch","-v",t?"-D":"-d",...e],parser(r,n){return De(r,n)},onError({exitCode:r,stdOut:n},s,i,o){if(!Yi(String(s),r))return o(s);i(n)}}}function Sc(e,t=!1){let r={format:"utf-8",commands:["branch","-v",t?"-D":"-d",e],parser(n,s){return De(n,s).branches[e]},onError({exitCode:n,stdErr:s,stdOut:i},o,a,l){if(!Yi(String(o),n))return l(o);throw new Xt(r.parser(Qt(i),Qt(s)),String(o))}};return r}var Ac=d({"src/lib/tasks/branch.ts"(){"use strict";qt(),Cc(),kc(),O()}}),to,Ec=d({"src/lib/responses/CheckIgnore.ts"(){"use strict";to=e=>e.split(/\n/g).map(t=>t.trim()).filter(t=>!!t)}}),eo={};W(eo,{checkIgnoreTask:()=>$c});function $c(e){return{commands:["check-ignore",...e],format:"utf-8",parser:to}}var Rc=d({"src/lib/tasks/check-ignore.ts"(){"use strict";Ec()}}),ro={};W(ro,{cloneMirrorTask:()=>Mc,cloneTask:()=>no});function Fc(e){return/^--upload-pack(=|$)/.test(e)}function no(e,t,r){let n=["clone",...r];return tt(e)&&n.push(e),tt(t)&&n.push(t),n.find(Fc)?ut("git.fetch: potential exploit argument blocked."):st(n)}function Mc(e,t,r){return $(r,"--mirror"),no(e,t,r)}var Dc=d({"src/lib/tasks/clone.ts"(){"use strict";V(),O()}});function Pc(e,t){return ct({raw:e,remote:null,branches:[],tags:[],updated:[],deleted:[]},so,[e,t])}var so,Ic=d({"src/lib/parsers/parse-fetch.ts"(){"use strict";O(),so=[new S(/From (.+)$/,(e,[t])=>{e.remote=t}),new S(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(e,[t,r])=>{e.branches.push({name:t,tracking:r})}),new S(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(e,[t,r])=>{e.tags.push({name:t,tracking:r})}),new S(/- \[deleted]\s+\S+\s*-> (.+)$/,(e,[t])=>{e.deleted.push({tracking:t})}),new S(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(e,[t,r,n,s])=>{e.updated.push({name:n,tracking:s,to:r,from:t})})]}}),io={};W(io,{fetchTask:()=>jc});function Lc(e){return/^--upload-pack(=|$)/.test(e)}function jc(e,t,r){let n=["fetch",...r];return e&&t&&n.push(e,t),n.find(Lc)?ut("git.fetch: potential exploit argument blocked."):{commands:n,format:"utf-8",parser:Pc}}var Nc=d({"src/lib/tasks/fetch.ts"(){"use strict";Ic(),V()}});function Hc(e){return ct({moves:[]},oo,e)}var oo,Bc=d({"src/lib/parsers/parse-move.ts"(){"use strict";O(),oo=[new S(/^Renaming (.+) to (.+)$/,(e,[t,r])=>{e.moves.push({from:t,to:r})})]}}),ao={};W(ao,{moveTask:()=>Gc});function Gc(e,t){return{commands:["mv","-v",...yt(e),t],format:"utf-8",parser:Hc}}var Vc=d({"src/lib/tasks/move.ts"(){"use strict";Bc(),O()}}),uo={};W(uo,{pullTask:()=>Wc});function Wc(e,t,r){let n=["pull",...r];return e&&t&&n.splice(1,0,e,t),{commands:n,format:"utf-8",parser(s,i){return Xr(s,i)},onError(s,i,o,a){let l=Qu(Qt(s.stdOut),Qt(s.stdErr));if(l)return a(new Xt(l));a(i)}}}var qc=d({"src/lib/tasks/pull.ts"(){"use strict";qt(),Fi(),O()}});function Uc(e){let t={};return co(e,([r])=>t[r]={name:r}),Object.values(t)}function zc(e){let t={};return co(e,([r,n,s])=>{t.hasOwnProperty(r)||(t[r]={name:r,refs:{fetch:"",push:""}}),s&&n&&(t[r].refs[s.replace(/[^a-z]/g,"")]=n)}),Object.values(t)}function co(e,t){Pr(e,r=>t(r.split(/\s+/)))}var Yc=d({"src/lib/responses/GetRemoteSummary.ts"(){"use strict";O()}}),lo={};W(lo,{addRemoteTask:()=>Jc,getRemotesTask:()=>Kc,listRemotesTask:()=>Qc,remoteTask:()=>Zc,removeRemoteTask:()=>Xc});function Jc(e,t,r){return st(["remote","add",...r,e,t])}function Kc(e){let t=["remote"];return e&&t.push("-v"),{commands:t,format:"utf-8",parser:e?zc:Uc}}function Qc(e){let t=[...e];return t[0]!=="ls-remote"&&t.unshift("ls-remote"),st(t)}function Zc(e){let t=[...e];return t[0]!=="remote"&&t.unshift("remote"),st(t)}function Xc(e){return st(["remote","remove",e])}var tl=d({"src/lib/tasks/remote.ts"(){"use strict";Yc(),V()}}),ho={};W(ho,{stashListTask:()=>el});function el(e={},t){let r=wi(e),n=["stash","list",...r.commands,...t],s=bi(r.splitter,r.fields,zr(n));return Me(n)||{commands:n,format:"utf-8",parser:s}}var rl=d({"src/lib/tasks/stash-list.ts"(){"use strict";ne(),vi(),Zr(),ki()}}),fo={};W(fo,{addSubModuleTask:()=>nl,initSubModuleTask:()=>sl,subModuleTask:()=>Pe,updateSubModuleTask:()=>il});function nl(e,t){return Pe(["add",e,t])}function sl(e){return Pe(["init",...e])}function Pe(e){let t=[...e];return t[0]!=="submodule"&&t.unshift("submodule"),st(t)}function il(e){return Pe(["update",...e])}var ol=d({"src/lib/tasks/sub-module.ts"(){"use strict";V()}});function al(e,t){let r=isNaN(e),n=isNaN(t);return r!==n?r?1:-1:r?po(e,t):0}function po(e,t){return e===t?0:e>t?1:-1}function ul(e){return e.trim()}function ge(e){return typeof e=="string"&&parseInt(e.replace(/^\D+/g,""),10)||0}var us,mo,cl=d({"src/lib/responses/TagList.ts"(){"use strict";us=class{constructor(e,t){this.all=e,this.latest=t}},mo=function(e,t=!1){let r=e.split(`
35
- `).map(ul).filter(Boolean);t||r.sort(function(s,i){let o=s.split("."),a=i.split(".");if(o.length===1||a.length===1)return al(ge(o[0]),ge(a[0]));for(let l=0,h=Math.max(o.length,a.length);l<h;l++){let u=po(ge(o[l]),ge(a[l]));if(u)return u}return 0});let n=t?r[0]:[...r].reverse().find(s=>s.indexOf(".")>=0);return new us(r,n)}}}),go={};W(go,{addAnnotatedTagTask:()=>fl,addTagTask:()=>hl,tagListTask:()=>ll});function ll(e=[]){let t=e.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...e],parser(r){return mo(r,t)}}}function hl(e){return{format:"utf-8",commands:["tag",e],parser(){return{name:e}}}}function fl(e,t){return{format:"utf-8",commands:["tag","-a","-m",t,e],parser(){return{name:e}}}}var pl=d({"src/lib/tasks/tag.ts"(){"use strict";cl()}}),ml=Ra({"src/git.js"(e,t){"use strict";var{GitExecutor:r}=(gu(),B(ui)),{SimpleGitApi:n}=(mc(),B(Gi)),{Scheduler:s}=(dc(),B(Vi)),{configurationErrorTask:i}=(V(),B(Tr)),{asArray:o,filterArray:a,filterPrimitives:l,filterString:h,filterStringOrStringArray:u,filterType:c,getTrailingOptions:f,trailingFunctionArgument:p,trailingOptionsArgument:E}=(O(),B(Rs)),{applyPatchTask:M}=(_c(),B(Ui)),{branchTask:I,branchLocalTask:N,deleteBranchesTask:J,deleteBranchTask:q}=(Ac(),B(Zi)),{checkIgnoreTask:Y}=(Rc(),B(eo)),{checkIsRepoTask:pt}=(Ps(),B(Fs)),{cloneTask:et,cloneMirrorTask:lt}=(Dc(),B(ro)),{cleanWithOptionsTask:F,isCleanOptionsArray:A}=(Us(),B(Ws)),{diffSummaryTask:Lt}=(Zr(),B(Ci)),{fetchTask:ie}=(Nc(),B(io)),{moveTask:k}=(Vc(),B(ao)),{pullTask:b}=(qc(),B(uo)),{pushTagsTask:g}=(Ii(),B(Pi)),{addRemoteTask:v,getRemotesTask:_,listRemotesTask:T,remoteTask:x,removeRemoteTask:D}=(tl(),B(lo)),{getResetMode:H,resetTask:U}=(si(),B(ei)),{stashListTask:K}=(rl(),B(ho)),{addSubModuleTask:it,initSubModuleTask:St,subModuleTask:wt,updateSubModuleTask:$t}=(ol(),B(fo)),{addAnnotatedTagTask:kt,addTagTask:Z,tagListTask:bt}=(pl(),B(go)),{straightThroughBufferTask:Rt,straightThroughStringTask:rt}=(V(),B(Tr));function C(m,y){this._plugins=y,this._executor=new r(m.baseDir,new s(m.maxConcurrentProcesses),y),this._trimmed=m.trimmed}(C.prototype=Object.create(n.prototype)).constructor=C,C.prototype.customBinary=function(m){return this._plugins.reconfigure("binary",m),this},C.prototype.env=function(m,y){return arguments.length===1&&typeof m=="object"?this._executor.env=m:(this._executor.env=this._executor.env||{})[m]=y,this},C.prototype.stashList=function(m){return this._runTask(K(E(arguments)||{},a(m)&&m||[]),p(arguments))};function sn(m,y,P,nt){return typeof P!="string"?i(`git.${m}() requires a string 'repoPath'`):y(P,c(nt,h),f(arguments))}C.prototype.clone=function(){return this._runTask(sn("clone",et,...arguments),p(arguments))},C.prototype.mirror=function(){return this._runTask(sn("mirror",lt,...arguments),p(arguments))},C.prototype.mv=function(m,y){return this._runTask(k(m,y),p(arguments))},C.prototype.checkoutLatestTag=function(m){var y=this;return this.pull(function(){y.tags(function(P,nt){y.checkout(nt.latest,m)})})},C.prototype.pull=function(m,y,P,nt){return this._runTask(b(c(m,h),c(y,h),f(arguments)),p(arguments))},C.prototype.fetch=function(m,y){return this._runTask(ie(c(m,h),c(y,h),f(arguments)),p(arguments))},C.prototype.silent=function(m){return console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this will be an error in version 3"),this},C.prototype.tags=function(m,y){return this._runTask(bt(f(arguments)),p(arguments))},C.prototype.rebase=function(){return this._runTask(rt(["rebase",...f(arguments)]),p(arguments))},C.prototype.reset=function(m){return this._runTask(U(H(m),f(arguments)),p(arguments))},C.prototype.revert=function(m){let y=p(arguments);return typeof m!="string"?this._runTask(i("Commit must be a string"),y):this._runTask(rt(["revert",...f(arguments,0,!0),m]),y)},C.prototype.addTag=function(m){let y=typeof m=="string"?Z(m):i("Git.addTag requires a tag name");return this._runTask(y,p(arguments))},C.prototype.addAnnotatedTag=function(m,y){return this._runTask(kt(m,y),p(arguments))},C.prototype.deleteLocalBranch=function(m,y,P){return this._runTask(q(m,typeof y=="boolean"?y:!1),p(arguments))},C.prototype.deleteLocalBranches=function(m,y,P){return this._runTask(J(m,typeof y=="boolean"?y:!1),p(arguments))},C.prototype.branch=function(m,y){return this._runTask(I(f(arguments)),p(arguments))},C.prototype.branchLocal=function(m){return this._runTask(N(),p(arguments))},C.prototype.raw=function(m){let y=!Array.isArray(m),P=[].slice.call(y?arguments:m,0);for(let dt=0;dt<P.length&&y;dt++)if(!l(P[dt])){P.splice(dt,P.length-dt);break}P.push(...f(arguments,0,!0));var nt=p(arguments);return P.length?this._runTask(rt(P,this._trimmed),nt):this._runTask(i("Raw: must supply one or more command to execute"),nt)},C.prototype.submoduleAdd=function(m,y,P){return this._runTask(it(m,y),p(arguments))},C.prototype.submoduleUpdate=function(m,y){return this._runTask($t(f(arguments,!0)),p(arguments))},C.prototype.submoduleInit=function(m,y){return this._runTask(St(f(arguments,!0)),p(arguments))},C.prototype.subModule=function(m,y){return this._runTask(wt(f(arguments)),p(arguments))},C.prototype.listRemote=function(){return this._runTask(T(f(arguments)),p(arguments))},C.prototype.addRemote=function(m,y,P){return this._runTask(v(m,y,f(arguments)),p(arguments))},C.prototype.removeRemote=function(m,y){return this._runTask(D(m),p(arguments))},C.prototype.getRemotes=function(m,y){return this._runTask(_(m===!0),p(arguments))},C.prototype.remote=function(m,y){return this._runTask(x(f(arguments)),p(arguments))},C.prototype.tag=function(m,y){let P=f(arguments);return P[0]!=="tag"&&P.unshift("tag"),this._runTask(rt(P),p(arguments))},C.prototype.updateServerInfo=function(m){return this._runTask(rt(["update-server-info"]),p(arguments))},C.prototype.pushTags=function(m,y){let P=g({remote:c(m,h)},f(arguments));return this._runTask(P,p(arguments))},C.prototype.rm=function(m){return this._runTask(rt(["rm","-f",...o(m)]),p(arguments))},C.prototype.rmKeepLocal=function(m){return this._runTask(rt(["rm","--cached",...o(m)]),p(arguments))},C.prototype.catFile=function(m,y){return this._catFile("utf-8",arguments)},C.prototype.binaryCatFile=function(){return this._catFile("buffer",arguments)},C.prototype._catFile=function(m,y){var P=p(y),nt=["cat-file"],dt=y[0];if(typeof dt=="string")return this._runTask(i("Git.catFile: options must be supplied as an array of strings"),P);Array.isArray(dt)&&nt.push.apply(nt,dt);let Le=m==="buffer"?Rt(nt):rt(nt);return this._runTask(Le,P)},C.prototype.diff=function(m,y){let P=h(m)?i("git.diff: supplying options as a single string is no longer supported, switch to an array of strings"):rt(["diff",...f(arguments)]);return this._runTask(P,p(arguments))},C.prototype.diffSummary=function(){return this._runTask(Lt(f(arguments,1)),p(arguments))},C.prototype.applyPatch=function(m){let y=u(m)?M(o(m),f([].slice.call(arguments,1))):i("git.applyPatch requires one or more string patches as the first argument");return this._runTask(y,p(arguments))},C.prototype.revparse=function(){let m=["rev-parse",...f(arguments,!0)];return this._runTask(rt(m,!0),p(arguments))},C.prototype.clean=function(m,y,P){let nt=A(m),dt=nt&&m.join("")||c(m,h)||"",Le=f([].slice.call(arguments,nt?1:0));return this._runTask(F(dt,Le),p(arguments))},C.prototype.exec=function(m){let y={commands:[],format:"utf-8",parser(){typeof m=="function"&&m()}};return this._runTask(y)},C.prototype.clearQueue=function(){return this},C.prototype.checkIgnore=function(m,y){return this._runTask(Y(o(c(m,u,[]))),p(arguments))},C.prototype.checkIsRepo=function(m,y){return this._runTask(pt(c(m,h)),p(arguments))},t.exports=C}});Zt();Et();var dl=class extends xt{constructor(e,t){super(void 0,t),this.config=e}};Et();Et();var Tt=class extends xt{constructor(e,t,r){super(e,r),this.task=e,this.plugin=t,Object.setPrototypeOf(this,new.target.prototype)}};qt();ms();Ps();Us();Js();Qs();ti();si();function gl(e){return e?[{type:"spawn.before",action(n,s){e.aborted&&s.kill(new Tt(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(n,s){function i(){s.kill(new Tt(void 0,"abort","Abort signal received"))}e.addEventListener("abort",i),s.spawned.on("close",()=>e.removeEventListener("abort",i))}}]:void 0}function _l(e){return typeof e=="string"&&e.trim().toLowerCase()==="-c"}function bl(e,t){if(_l(e)&&/^\s*protocol(.[a-z]+)?.allow/.test(t))throw new Tt(void 0,"unsafe","Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol")}function yl(e,t){if(/^\s*--(upload|receive)-pack/.test(e))throw new Tt(void 0,"unsafe","Use of --upload-pack or --receive-pack is not permitted without enabling allowUnsafePack");if(t==="clone"&&/^\s*-u\b/.test(e))throw new Tt(void 0,"unsafe","Use of clone with option -u is not permitted without enabling allowUnsafePack");if(t==="push"&&/^\s*--exec\b/.test(e))throw new Tt(void 0,"unsafe","Use of push with option --exec is not permitted without enabling allowUnsafePack")}function vl({allowUnsafeProtocolOverride:e=!1,allowUnsafePack:t=!1}={}){return{type:"spawn.args",action(r,n){return r.forEach((s,i)=>{let o=i<r.length?r[i+1]:"";e||bl(s,o),t||yl(s,n.method)}),r}}}O();function Cl(e){let t=Kt(e,"-c");return{type:"spawn.args",action(r){return[...t,...r]}}}O();var cs=(0,Vt.deferred)().promise;function wl({onClose:e=!0,onExit:t=50}={}){function r(){let s=-1,i={close:(0,Vt.deferred)(),closeTimeout:(0,Vt.deferred)(),exit:(0,Vt.deferred)(),exitTimeout:(0,Vt.deferred)()},o=Promise.race([e===!1?cs:i.closeTimeout.promise,t===!1?cs:i.exitTimeout.promise]);return n(e,i.close,i.closeTimeout),n(t,i.exit,i.exitTimeout),{close(a){s=a,i.close.done()},exit(a){s=a,i.exit.done()},get exitCode(){return s},result:o}}function n(s,i,o){s!==!1&&(s===!0?i.promise:i.promise.then(()=>yr(s))).then(o.done)}return{type:"spawn.after",async action(s,{spawned:i,close:o}){let a=r(),l=!0,h=()=>void(l=!1);i.stdout?.on("data",h),i.stderr?.on("data",h),i.on("error",h),i.on("close",u=>a.close(u)),i.on("exit",u=>a.exit(u));try{await a.result,l&&await yr(50),o(a.exitCode)}catch(u){o(a.exitCode,u)}}}}O();var kl="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",ls="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function Ol(e){return!e||!/^([a-z]:)?([a-z0-9/.\\_-]+)$/i.test(e)}function hs(e,t){if(e.length<1||e.length>2)throw new Tt(void 0,"binary",kl);if(e.some(Ol))if(t)console.warn(ls);else throw new Tt(void 0,"binary",ls);let[n,s]=e;return{binary:n,prefix:s}}function Tl(e,t=["git"],r=!1){let n=hs(yt(t),r);e.on("binary",s=>{n=hs(yt(s),r)}),e.append("spawn.binary",()=>n.binary),e.append("spawn.args",s=>n.prefix?[n.prefix,...s]:s)}Et();function xl(e){return!!(e.exitCode&&e.stdErr.length)}function Sl(e){return Buffer.concat([...e.stdOut,...e.stdErr])}function Al(e=!1,t=xl,r=Sl){return(n,s)=>!e&&n||!t(s)?n:r(s)}function fs(e){return{type:"task.error",action(t,r){let n=e(t.error,{stdErr:r.stdErr,stdOut:r.stdOut,exitCode:r.exitCode});return Buffer.isBuffer(n)?{error:new xt(void 0,n.toString("utf-8"))}:{error:n}}}}O();var El=class{constructor(){this.plugins=new Set,this.events=new _o.EventEmitter}on(e,t){this.events.on(e,t)}reconfigure(e,t){this.events.emit(e,t)}append(e,t){let r=$(this.plugins,{type:e,action:t});return()=>this.plugins.delete(r)}add(e){let t=[];return yt(e).forEach(r=>r&&this.plugins.add($(t,r))),()=>{t.forEach(r=>this.plugins.delete(r))}}exec(e,t,r){let n=t,s=Object.freeze(Object.create(r));for(let i of this.plugins)i.type===e&&(n=i.action(n,s));return n}};O();function $l(e){let t="--progress",r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(i,o){return r.includes(o.method)?Cs(i,t):i}},{type:"spawn.after",action(i,o){o.commands.includes(t)&&o.spawned.stderr?.on("data",a=>{let l=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(a.toString("utf8"));l&&e({method:o.method,stage:Rl(l[1]),progress:L(l[2]),processed:L(l[3]),total:L(l[4])})})}}]}function Rl(e){return String(e.toLowerCase().split(" ",1))||"unknown"}O();function Fl(e){let t=Os(e,["uid","gid"]);return{type:"spawn.options",action(r){return{...t,...r}}}}function Ml({block:e,stdErr:t=!0,stdOut:r=!0}){if(e>0)return{type:"spawn.after",action(n,s){let i;function o(){i&&clearTimeout(i),i=setTimeout(l,e)}function a(){s.spawned.stdout?.off("data",o),s.spawned.stderr?.off("data",o),s.spawned.off("exit",a),s.spawned.off("close",a),i&&clearTimeout(i)}function l(){a(),s.kill(new Tt(void 0,"timeout","block timeout reached"))}r&&s.spawned.stdout?.on("data",o),t&&s.spawned.stderr?.on("data",o),s.spawned.on("exit",a),s.spawned.on("close",a),o()}}}Zt();function Dl(){return{type:"spawn.args",action(e){let t=[],r;function n(s){(r=r||[]).push(...s)}for(let s=0;s<e.length;s++){let i=e[s];if(Ce(i)){n(In(i));continue}if(i==="--"){n(e.slice(s+1).flatMap(o=>Ce(o)&&In(o)||o));break}t.push(i)}return r?[...t,"--",...r.map(String)]:t}}}O();var Pl=ml();function Il(e,t){let r=new El,n=Es(e&&(typeof e=="string"?{baseDir:e}:e)||{},t);if(!Ir(n.baseDir))throw new dl(n,"Cannot use simple-git on a directory that does not exist");return Array.isArray(n.config)&&r.add(Cl(n.config)),r.add(vl(n.unsafe)),r.add(Dl()),r.add(wl(n.completion)),n.abort&&r.add(gl(n.abort)),n.progress&&r.add($l(n.progress)),n.timeout&&r.add(Ml(n.timeout)),n.spawnOptions&&r.add(Fl(n.spawnOptions)),r.add(fs(Al(!0))),n.errors&&r.add(fs(n.errors)),Tl(r,n.binary,n.unsafe?.allowUnsafeCustomBinary),new Pl(n,r)}qt();var bo=Il;var vo="@lntvow/dev",Co="4.4.4";w();var Ut=gt(require("fs"),1),se=gt(require("path"),1),wo=require("url"),rn=gt(rr(),1),Ll=(0,wo.fileURLToPath)(j),jl=se.default.dirname(Ll);function ko(e,t){Ut.default.existsSync(t)||Ut.default.mkdirSync(t),Ut.default.readdirSync(e,{withFileTypes:!0}).forEach(n=>{let s=se.default.resolve(e,n.name),i=se.default.resolve(t,n.name);if(n.isDirectory())ko(s,i);else{if(Ut.default.existsSync(i))return;Ut.default.copyFileSync(s,i)}})}function Oo(){console.log(rn.default.blue("Start copying template files")),ko(se.default.resolve(jl,"./configs"),process.cwd()),console.log(rn.default.green("Template files copied successfully"))}nn.default.extend(So.default);console.log(Ct.default.blue(`Cwd is ${process.cwd()}`));Yt.name(vo).version(Co,"-v, --version","output the version number");Yt.command("init").option("-t, --temp","copy template files",!0).option("--no-temp","not copy template files").option("-g, --git","init simple-git-hooks",!0).option("--no-git","not init simple-git-hooks").option("-s, --scripts","init scripts",!0).option("--no-scripts","not init scripts").description("init project").action(e=>{console.log(Ct.default.green("Init project by @lntvow/dev"));let{temp:t,git:r,scripts:n}=e;if(t&&Oo(),r){console.log(Ct.default.blue("Start init simple-git-hooks"));let s=(0,To.execSync)("npx simple-git-hooks");console.log(s.toString())}if(n){console.log(Ct.default.blue("Start init scripts"));try{let s=(0,xo.resolve)(process.cwd(),"package.json"),i=JSON.parse((0,Ie.readFileSync)(s,"utf-8"));i={...i,scripts:{postinstall:"simple-git-hooks",rimraf:"rimraf ./node_modules/",commit:"git add . && git-cz && git push",release:"git add . && bumpp package.json --all --no-tag --no-print-commits","lint:eslint":'eslint "src/**/*.{js,jsx,ts,tsx,vue}" --fix',"lint:tsc":"tsc --noEmit",lint:"run-p lint:eslint lint:tsc",ncu:"ncu -u && pnpm install",...i.scripts}},(0,Ie.writeFileSync)(s,JSON.stringify(i,null,2)),console.log(Ct.default.green("Scripts added successfully"))}catch{console.log(Ct.default.yellow("No package.json file found ignoring scripts"))}}console.log(Ct.default.yellow(`
35
+ `).map(ul).filter(Boolean);t||r.sort(function(s,i){let o=s.split("."),a=i.split(".");if(o.length===1||a.length===1)return al(ge(o[0]),ge(a[0]));for(let l=0,h=Math.max(o.length,a.length);l<h;l++){let u=po(ge(o[l]),ge(a[l]));if(u)return u}return 0});let n=t?r[0]:[...r].reverse().find(s=>s.indexOf(".")>=0);return new us(r,n)}}}),go={};W(go,{addAnnotatedTagTask:()=>fl,addTagTask:()=>hl,tagListTask:()=>ll});function ll(e=[]){let t=e.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...e],parser(r){return mo(r,t)}}}function hl(e){return{format:"utf-8",commands:["tag",e],parser(){return{name:e}}}}function fl(e,t){return{format:"utf-8",commands:["tag","-a","-m",t,e],parser(){return{name:e}}}}var pl=d({"src/lib/tasks/tag.ts"(){"use strict";cl()}}),ml=Ra({"src/git.js"(e,t){"use strict";var{GitExecutor:r}=(gu(),B(ui)),{SimpleGitApi:n}=(mc(),B(Gi)),{Scheduler:s}=(dc(),B(Vi)),{configurationErrorTask:i}=(V(),B(Tr)),{asArray:o,filterArray:a,filterPrimitives:l,filterString:h,filterStringOrStringArray:u,filterType:c,getTrailingOptions:f,trailingFunctionArgument:p,trailingOptionsArgument:E}=(O(),B(Rs)),{applyPatchTask:M}=(_c(),B(Ui)),{branchTask:I,branchLocalTask:N,deleteBranchesTask:J,deleteBranchTask:q}=(Ac(),B(Zi)),{checkIgnoreTask:Y}=(Rc(),B(eo)),{checkIsRepoTask:pt}=(Ps(),B(Fs)),{cloneTask:et,cloneMirrorTask:lt}=(Dc(),B(ro)),{cleanWithOptionsTask:F,isCleanOptionsArray:A}=(Us(),B(Ws)),{diffSummaryTask:Lt}=(Zr(),B(Ci)),{fetchTask:ie}=(Nc(),B(io)),{moveTask:k}=(Vc(),B(ao)),{pullTask:b}=(qc(),B(uo)),{pushTagsTask:g}=(Ii(),B(Pi)),{addRemoteTask:v,getRemotesTask:_,listRemotesTask:T,remoteTask:x,removeRemoteTask:D}=(tl(),B(lo)),{getResetMode:H,resetTask:U}=(si(),B(ei)),{stashListTask:K}=(rl(),B(ho)),{addSubModuleTask:it,initSubModuleTask:St,subModuleTask:wt,updateSubModuleTask:$t}=(ol(),B(fo)),{addAnnotatedTagTask:kt,addTagTask:Z,tagListTask:bt}=(pl(),B(go)),{straightThroughBufferTask:Rt,straightThroughStringTask:rt}=(V(),B(Tr));function C(m,y){this._plugins=y,this._executor=new r(m.baseDir,new s(m.maxConcurrentProcesses),y),this._trimmed=m.trimmed}(C.prototype=Object.create(n.prototype)).constructor=C,C.prototype.customBinary=function(m){return this._plugins.reconfigure("binary",m),this},C.prototype.env=function(m,y){return arguments.length===1&&typeof m=="object"?this._executor.env=m:(this._executor.env=this._executor.env||{})[m]=y,this},C.prototype.stashList=function(m){return this._runTask(K(E(arguments)||{},a(m)&&m||[]),p(arguments))};function sn(m,y,P,nt){return typeof P!="string"?i(`git.${m}() requires a string 'repoPath'`):y(P,c(nt,h),f(arguments))}C.prototype.clone=function(){return this._runTask(sn("clone",et,...arguments),p(arguments))},C.prototype.mirror=function(){return this._runTask(sn("mirror",lt,...arguments),p(arguments))},C.prototype.mv=function(m,y){return this._runTask(k(m,y),p(arguments))},C.prototype.checkoutLatestTag=function(m){var y=this;return this.pull(function(){y.tags(function(P,nt){y.checkout(nt.latest,m)})})},C.prototype.pull=function(m,y,P,nt){return this._runTask(b(c(m,h),c(y,h),f(arguments)),p(arguments))},C.prototype.fetch=function(m,y){return this._runTask(ie(c(m,h),c(y,h),f(arguments)),p(arguments))},C.prototype.silent=function(m){return console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this will be an error in version 3"),this},C.prototype.tags=function(m,y){return this._runTask(bt(f(arguments)),p(arguments))},C.prototype.rebase=function(){return this._runTask(rt(["rebase",...f(arguments)]),p(arguments))},C.prototype.reset=function(m){return this._runTask(U(H(m),f(arguments)),p(arguments))},C.prototype.revert=function(m){let y=p(arguments);return typeof m!="string"?this._runTask(i("Commit must be a string"),y):this._runTask(rt(["revert",...f(arguments,0,!0),m]),y)},C.prototype.addTag=function(m){let y=typeof m=="string"?Z(m):i("Git.addTag requires a tag name");return this._runTask(y,p(arguments))},C.prototype.addAnnotatedTag=function(m,y){return this._runTask(kt(m,y),p(arguments))},C.prototype.deleteLocalBranch=function(m,y,P){return this._runTask(q(m,typeof y=="boolean"?y:!1),p(arguments))},C.prototype.deleteLocalBranches=function(m,y,P){return this._runTask(J(m,typeof y=="boolean"?y:!1),p(arguments))},C.prototype.branch=function(m,y){return this._runTask(I(f(arguments)),p(arguments))},C.prototype.branchLocal=function(m){return this._runTask(N(),p(arguments))},C.prototype.raw=function(m){let y=!Array.isArray(m),P=[].slice.call(y?arguments:m,0);for(let dt=0;dt<P.length&&y;dt++)if(!l(P[dt])){P.splice(dt,P.length-dt);break}P.push(...f(arguments,0,!0));var nt=p(arguments);return P.length?this._runTask(rt(P,this._trimmed),nt):this._runTask(i("Raw: must supply one or more command to execute"),nt)},C.prototype.submoduleAdd=function(m,y,P){return this._runTask(it(m,y),p(arguments))},C.prototype.submoduleUpdate=function(m,y){return this._runTask($t(f(arguments,!0)),p(arguments))},C.prototype.submoduleInit=function(m,y){return this._runTask(St(f(arguments,!0)),p(arguments))},C.prototype.subModule=function(m,y){return this._runTask(wt(f(arguments)),p(arguments))},C.prototype.listRemote=function(){return this._runTask(T(f(arguments)),p(arguments))},C.prototype.addRemote=function(m,y,P){return this._runTask(v(m,y,f(arguments)),p(arguments))},C.prototype.removeRemote=function(m,y){return this._runTask(D(m),p(arguments))},C.prototype.getRemotes=function(m,y){return this._runTask(_(m===!0),p(arguments))},C.prototype.remote=function(m,y){return this._runTask(x(f(arguments)),p(arguments))},C.prototype.tag=function(m,y){let P=f(arguments);return P[0]!=="tag"&&P.unshift("tag"),this._runTask(rt(P),p(arguments))},C.prototype.updateServerInfo=function(m){return this._runTask(rt(["update-server-info"]),p(arguments))},C.prototype.pushTags=function(m,y){let P=g({remote:c(m,h)},f(arguments));return this._runTask(P,p(arguments))},C.prototype.rm=function(m){return this._runTask(rt(["rm","-f",...o(m)]),p(arguments))},C.prototype.rmKeepLocal=function(m){return this._runTask(rt(["rm","--cached",...o(m)]),p(arguments))},C.prototype.catFile=function(m,y){return this._catFile("utf-8",arguments)},C.prototype.binaryCatFile=function(){return this._catFile("buffer",arguments)},C.prototype._catFile=function(m,y){var P=p(y),nt=["cat-file"],dt=y[0];if(typeof dt=="string")return this._runTask(i("Git.catFile: options must be supplied as an array of strings"),P);Array.isArray(dt)&&nt.push.apply(nt,dt);let Le=m==="buffer"?Rt(nt):rt(nt);return this._runTask(Le,P)},C.prototype.diff=function(m,y){let P=h(m)?i("git.diff: supplying options as a single string is no longer supported, switch to an array of strings"):rt(["diff",...f(arguments)]);return this._runTask(P,p(arguments))},C.prototype.diffSummary=function(){return this._runTask(Lt(f(arguments,1)),p(arguments))},C.prototype.applyPatch=function(m){let y=u(m)?M(o(m),f([].slice.call(arguments,1))):i("git.applyPatch requires one or more string patches as the first argument");return this._runTask(y,p(arguments))},C.prototype.revparse=function(){let m=["rev-parse",...f(arguments,!0)];return this._runTask(rt(m,!0),p(arguments))},C.prototype.clean=function(m,y,P){let nt=A(m),dt=nt&&m.join("")||c(m,h)||"",Le=f([].slice.call(arguments,nt?1:0));return this._runTask(F(dt,Le),p(arguments))},C.prototype.exec=function(m){let y={commands:[],format:"utf-8",parser(){typeof m=="function"&&m()}};return this._runTask(y)},C.prototype.clearQueue=function(){return this},C.prototype.checkIgnore=function(m,y){return this._runTask(Y(o(c(m,u,[]))),p(arguments))},C.prototype.checkIsRepo=function(m,y){return this._runTask(pt(c(m,h)),p(arguments))},t.exports=C}});Zt();Et();var dl=class extends xt{constructor(e,t){super(void 0,t),this.config=e}};Et();Et();var Tt=class extends xt{constructor(e,t,r){super(e,r),this.task=e,this.plugin=t,Object.setPrototypeOf(this,new.target.prototype)}};qt();ms();Ps();Us();Js();Qs();ti();si();function gl(e){return e?[{type:"spawn.before",action(n,s){e.aborted&&s.kill(new Tt(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(n,s){function i(){s.kill(new Tt(void 0,"abort","Abort signal received"))}e.addEventListener("abort",i),s.spawned.on("close",()=>e.removeEventListener("abort",i))}}]:void 0}function _l(e){return typeof e=="string"&&e.trim().toLowerCase()==="-c"}function bl(e,t){if(_l(e)&&/^\s*protocol(.[a-z]+)?.allow/.test(t))throw new Tt(void 0,"unsafe","Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol")}function yl(e,t){if(/^\s*--(upload|receive)-pack/.test(e))throw new Tt(void 0,"unsafe","Use of --upload-pack or --receive-pack is not permitted without enabling allowUnsafePack");if(t==="clone"&&/^\s*-u\b/.test(e))throw new Tt(void 0,"unsafe","Use of clone with option -u is not permitted without enabling allowUnsafePack");if(t==="push"&&/^\s*--exec\b/.test(e))throw new Tt(void 0,"unsafe","Use of push with option --exec is not permitted without enabling allowUnsafePack")}function vl({allowUnsafeProtocolOverride:e=!1,allowUnsafePack:t=!1}={}){return{type:"spawn.args",action(r,n){return r.forEach((s,i)=>{let o=i<r.length?r[i+1]:"";e||bl(s,o),t||yl(s,n.method)}),r}}}O();function Cl(e){let t=Kt(e,"-c");return{type:"spawn.args",action(r){return[...t,...r]}}}O();var cs=(0,Vt.deferred)().promise;function wl({onClose:e=!0,onExit:t=50}={}){function r(){let s=-1,i={close:(0,Vt.deferred)(),closeTimeout:(0,Vt.deferred)(),exit:(0,Vt.deferred)(),exitTimeout:(0,Vt.deferred)()},o=Promise.race([e===!1?cs:i.closeTimeout.promise,t===!1?cs:i.exitTimeout.promise]);return n(e,i.close,i.closeTimeout),n(t,i.exit,i.exitTimeout),{close(a){s=a,i.close.done()},exit(a){s=a,i.exit.done()},get exitCode(){return s},result:o}}function n(s,i,o){s!==!1&&(s===!0?i.promise:i.promise.then(()=>yr(s))).then(o.done)}return{type:"spawn.after",async action(s,{spawned:i,close:o}){let a=r(),l=!0,h=()=>void(l=!1);i.stdout?.on("data",h),i.stderr?.on("data",h),i.on("error",h),i.on("close",u=>a.close(u)),i.on("exit",u=>a.exit(u));try{await a.result,l&&await yr(50),o(a.exitCode)}catch(u){o(a.exitCode,u)}}}}O();var kl="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",ls="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function Ol(e){return!e||!/^([a-z]:)?([a-z0-9/.\\_-]+)$/i.test(e)}function hs(e,t){if(e.length<1||e.length>2)throw new Tt(void 0,"binary",kl);if(e.some(Ol))if(t)console.warn(ls);else throw new Tt(void 0,"binary",ls);let[n,s]=e;return{binary:n,prefix:s}}function Tl(e,t=["git"],r=!1){let n=hs(yt(t),r);e.on("binary",s=>{n=hs(yt(s),r)}),e.append("spawn.binary",()=>n.binary),e.append("spawn.args",s=>n.prefix?[n.prefix,...s]:s)}Et();function xl(e){return!!(e.exitCode&&e.stdErr.length)}function Sl(e){return Buffer.concat([...e.stdOut,...e.stdErr])}function Al(e=!1,t=xl,r=Sl){return(n,s)=>!e&&n||!t(s)?n:r(s)}function fs(e){return{type:"task.error",action(t,r){let n=e(t.error,{stdErr:r.stdErr,stdOut:r.stdOut,exitCode:r.exitCode});return Buffer.isBuffer(n)?{error:new xt(void 0,n.toString("utf-8"))}:{error:n}}}}O();var El=class{constructor(){this.plugins=new Set,this.events=new _o.EventEmitter}on(e,t){this.events.on(e,t)}reconfigure(e,t){this.events.emit(e,t)}append(e,t){let r=$(this.plugins,{type:e,action:t});return()=>this.plugins.delete(r)}add(e){let t=[];return yt(e).forEach(r=>r&&this.plugins.add($(t,r))),()=>{t.forEach(r=>this.plugins.delete(r))}}exec(e,t,r){let n=t,s=Object.freeze(Object.create(r));for(let i of this.plugins)i.type===e&&(n=i.action(n,s));return n}};O();function $l(e){let t="--progress",r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(i,o){return r.includes(o.method)?Cs(i,t):i}},{type:"spawn.after",action(i,o){o.commands.includes(t)&&o.spawned.stderr?.on("data",a=>{let l=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(a.toString("utf8"));l&&e({method:o.method,stage:Rl(l[1]),progress:L(l[2]),processed:L(l[3]),total:L(l[4])})})}}]}function Rl(e){return String(e.toLowerCase().split(" ",1))||"unknown"}O();function Fl(e){let t=Os(e,["uid","gid"]);return{type:"spawn.options",action(r){return{...t,...r}}}}function Ml({block:e,stdErr:t=!0,stdOut:r=!0}){if(e>0)return{type:"spawn.after",action(n,s){let i;function o(){i&&clearTimeout(i),i=setTimeout(l,e)}function a(){s.spawned.stdout?.off("data",o),s.spawned.stderr?.off("data",o),s.spawned.off("exit",a),s.spawned.off("close",a),i&&clearTimeout(i)}function l(){a(),s.kill(new Tt(void 0,"timeout","block timeout reached"))}r&&s.spawned.stdout?.on("data",o),t&&s.spawned.stderr?.on("data",o),s.spawned.on("exit",a),s.spawned.on("close",a),o()}}}Zt();function Dl(){return{type:"spawn.args",action(e){let t=[],r;function n(s){(r=r||[]).push(...s)}for(let s=0;s<e.length;s++){let i=e[s];if(Ce(i)){n(In(i));continue}if(i==="--"){n(e.slice(s+1).flatMap(o=>Ce(o)&&In(o)||o));break}t.push(i)}return r?[...t,"--",...r.map(String)]:t}}}O();var Pl=ml();function Il(e,t){let r=new El,n=Es(e&&(typeof e=="string"?{baseDir:e}:e)||{},t);if(!Ir(n.baseDir))throw new dl(n,"Cannot use simple-git on a directory that does not exist");return Array.isArray(n.config)&&r.add(Cl(n.config)),r.add(vl(n.unsafe)),r.add(Dl()),r.add(wl(n.completion)),n.abort&&r.add(gl(n.abort)),n.progress&&r.add($l(n.progress)),n.timeout&&r.add(Ml(n.timeout)),n.spawnOptions&&r.add(Fl(n.spawnOptions)),r.add(fs(Al(!0))),n.errors&&r.add(fs(n.errors)),Tl(r,n.binary,n.unsafe?.allowUnsafeCustomBinary),new Pl(n,r)}qt();var bo=Il;var vo="@lntvow/dev",Co="4.4.5";w();var Ut=gt(require("fs"),1),se=gt(require("path"),1),wo=require("url"),rn=gt(rr(),1),Ll=(0,wo.fileURLToPath)(j),jl=se.default.dirname(Ll);function ko(e,t){Ut.default.existsSync(t)||Ut.default.mkdirSync(t),Ut.default.readdirSync(e,{withFileTypes:!0}).forEach(n=>{let s=se.default.resolve(e,n.name),i=se.default.resolve(t,n.name);if(n.isDirectory())ko(s,i);else{if(Ut.default.existsSync(i))return;Ut.default.copyFileSync(s,i)}})}function Oo(){console.log(rn.default.blue("Start copying template files")),ko(se.default.resolve(jl,"./configs"),process.cwd()),console.log(rn.default.green("Template files copied successfully"))}nn.default.extend(So.default);console.log(Ct.default.blue(`Cwd is ${process.cwd()}`));Yt.name(vo).version(Co,"-v, --version","output the version number");Yt.command("init").option("-t, --temp","copy template files",!0).option("--no-temp","not copy template files").option("-g, --git","init simple-git-hooks",!0).option("--no-git","not init simple-git-hooks").option("-s, --scripts","init scripts",!0).option("--no-scripts","not init scripts").description("init project").action(e=>{console.log(Ct.default.green("Init project by @lntvow/dev"));let{temp:t,git:r,scripts:n}=e;if(t&&Oo(),r){console.log(Ct.default.blue("Start init simple-git-hooks"));let s=(0,To.execSync)("npx simple-git-hooks");console.log(s.toString())}if(n){console.log(Ct.default.blue("Start init scripts"));try{let s=(0,xo.resolve)(process.cwd(),"package.json"),i=JSON.parse((0,Ie.readFileSync)(s,"utf-8"));i={...i,scripts:{postinstall:"simple-git-hooks",rimraf:"rimraf ./node_modules/",commit:"git add . && git-cz && git push",release:"git add . && bumpp package.json --all --no-tag --no-print-commits","lint:eslint":'eslint "src/**/*.{js,jsx,ts,tsx,vue}" --fix',"lint:tsc":"tsc --noEmit",lint:"run-p lint:eslint lint:tsc",ncu:"ncu -u && pnpm install",...i.scripts}},(0,Ie.writeFileSync)(s,JSON.stringify(i,null,2)),console.log(Ct.default.green("Scripts added successfully"))}catch{console.log(Ct.default.yellow("No package.json file found ignoring scripts"))}}console.log(Ct.default.yellow(`
36
36
  You may need to re-execute the "pnpm install" command`))});Yt.command("release").description("git release").action(async()=>{console.log(Ct.default.green("Release project...")),await Nl()});Yt.parse();async function Nl(){let e=bo(),t=(0,nn.default)().format("YYYYMMDD");await e.cwd(process.cwd()),await e.pull(),await e.add("."),await e.commit(t,"--no-verify"),await e.push("origin"),console.log(Ct.default.green(`Changes committed with message: ${t}`))}
package/dist/cli.mjs CHANGED
@@ -32,5 +32,5 @@ Expecting one of '${n.join("', '")}'`);let s=`${t}Help`;return this.on(s,i=>{let
32
32
  `){return e.split(r).reduce((n,s)=>{let i=t?s.trim():s;return i&&n.push(i),n},[])}function Ir(e,t){return ee(e,!0).map(r=>t(r))}function Lr(e){return(0,Ae.exists)(e,Ae.FOLDER)}function $(e,t){return Array.isArray(e)?e.includes(t)||e.push(t):e.add(t),t}function Cs(e,t){return Array.isArray(e)&&!e.includes(t)&&e.push(t),e}function Ee(e,t){if(Array.isArray(e)){let r=e.indexOf(t);r>=0&&e.splice(r,1)}else e.delete(t);return t}function yt(e){return Array.isArray(e)?e:[e]}function ws(e){return e.replace(/[\s-]+(.)/g,(t,r)=>r.toUpperCase())}function ks(e){return yt(e).map(String)}function L(e,t=0){if(e==null)return t;let r=parseInt(e,10);return isNaN(r)?t:r}function Qt(e,t){let r=[];for(let n=0,s=e.length;n<s;n++)r.push(t,e[n]);return r}function Zt(e){return(Array.isArray(e)?Aa.concat(e):e).toString("utf-8")}function Os(e,t){return Object.assign({},...t.map(r=>r in e?{[r]:e[r]}:{}))}function vr(e=0){return new Promise(t=>setTimeout(t,e))}function Cr(e){if(e!==!1)return e}var Ut,jt,re,$e=d({"src/lib/utils/util.ts"(){"use strict";Ut="\0",jt=()=>{},re=Object.prototype.toString.call.bind(Object.prototype.toString)}});function vt(e,t,r){return t(e)?e:arguments.length>2?r:void 0}function wr(e,t){let r=we(e)?"string":typeof e;return/number|string|boolean/.test(r)&&(!t||!t.includes(r))}function Re(e){return!!e&&re(e)==="[object Object]"}function Ts(e){return typeof e=="function"}var ne,et,xs,ke,jr,Ss=d({"src/lib/utils/argument-filters.ts"(){"use strict";$e(),Xt(),ne=e=>Array.isArray(e),et=e=>typeof e=="string",xs=e=>Array.isArray(e)&&e.every(et),ke=e=>et(e)||Array.isArray(e)&&e.every(et),jr=e=>e==null||"number|boolean|function".includes(typeof e)?!1:Array.isArray(e)||typeof e=="string"||typeof e.length=="number"}}),kr,Ea=d({"src/lib/utils/exit-codes.ts"(){"use strict";kr=(e=>(e[e.SUCCESS=0]="SUCCESS",e[e.ERROR=1]="ERROR",e[e.NOT_FOUND=-2]="NOT_FOUND",e[e.UNCLEAN=128]="UNCLEAN",e))(kr||{})}}),Oe,$a=d({"src/lib/utils/git-output-streams.ts"(){"use strict";Oe=class As{constructor(t,r){this.stdOut=t,this.stdErr=r}asStrings(){return new As(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}}),S,$t,Ra=d({"src/lib/utils/line-parser.ts"(){"use strict";S=class{constructor(e,t){this.matches=[],this.parse=(r,n)=>(this.resetMatches(),this._regExp.every((s,i)=>this.addMatch(s,i,r(i)))?this.useMatches(n,this.prepareMatches())!==!1:!1),this._regExp=Array.isArray(e)?e:[e],t&&(this.useMatches=t)}useMatches(e,t){throw new Error("LineParser:useMatches not implemented")}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(e,t,r){let n=r&&e.exec(r);return n&&this.pushMatch(t,n),!!n}pushMatch(e,t){this.matches.push(...t.slice(1))}},$t=class extends S{addMatch(e,t,r){return/^remote:\s/.test(String(r))&&super.addMatch(e,t,r)}pushMatch(e,t){(e>0||t.length>1)&&super.pushMatch(e,t)}}}});function Es(...e){let t=process.cwd(),r=Object.assign({baseDir:t,...$s},...e.filter(n=>typeof n=="object"&&n));return r.baseDir=r.baseDir||t,r.trimmed=r.trimmed===!0,r}var $s,Fa=d({"src/lib/utils/simple-git-options.ts"(){"use strict";$s={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function Nr(e,t=[]){return Re(e)?Object.keys(e).reduce((r,n)=>{let s=e[n];if(we(s))r.push(s);else if(wr(s,["boolean"]))r.push(n+"="+s);else if(Array.isArray(s))for(let i of s)wr(i,["string","number"])||r.push(n+"="+i);else r.push(n);return r},t):t}function ut(e,t=0,r=!1){let n=[];for(let s=0,i=t<0?e.length:t;s<i;s++)"string|number".includes(typeof e[s])&&n.push(String(e[s]));return Nr(Hr(e),n),r||n.push(...Ma(e)),n}function Ma(e){let t=typeof Lt(e)=="function";return vt(Lt(e,t?1:0),ne,[])}function Hr(e){let t=Ts(Lt(e));return vt(Lt(e,t?1:0),Re)}function V(e,t=!0){let r=gs(Lt(e));return t||_s(r)?r:void 0}var Da=d({"src/lib/utils/task-options.ts"(){"use strict";Ss(),$e(),Xt()}});function Or(e,t){return e(t.stdOut,t.stdErr)}function lt(e,t,r,n=!0){return yt(r).forEach(s=>{for(let i=ee(s,n),o=0,a=i.length;o<a;o++){let l=(h=0)=>{if(!(o+h>=a))return i[o+h]};t.some(({parse:h})=>h(l,e))}}),e}var Pa=d({"src/lib/utils/task-parser.ts"(){"use strict";$e()}}),Rs={};q(Rs,{ExitCodes:()=>kr,GitOutputStreams:()=>Oe,LineParser:()=>S,NOOP:()=>jt,NULL:()=>Ut,RemoteLineParser:()=>$t,append:()=>$,appendTaskOptions:()=>Nr,asArray:()=>yt,asCamelCase:()=>ws,asFunction:()=>gs,asNumber:()=>L,asStringArray:()=>ks,bufferToString:()=>Zt,callTaskParser:()=>Or,createInstanceConfig:()=>Es,delay:()=>vr,filterArray:()=>ne,filterFunction:()=>Ts,filterHasLength:()=>jr,filterPlainObject:()=>Re,filterPrimitives:()=>wr,filterString:()=>et,filterStringArray:()=>xs,filterStringOrStringArray:()=>ke,filterType:()=>vt,first:()=>ys,folderExists:()=>Lr,forEachLineWithContent:()=>Ir,getTrailingOptions:()=>ut,including:()=>Cs,isUserFunction:()=>_s,last:()=>Lt,objectToString:()=>re,orVoid:()=>Cr,parseStringResponse:()=>lt,pick:()=>Os,prefixedArray:()=>Qt,remove:()=>Ee,splitOn:()=>bs,toLinesWithContent:()=>ee,trailingFunctionArgument:()=>V,trailingOptionsArgument:()=>Hr});var O=d({"src/lib/utils/index.ts"(){"use strict";Ss(),Ea(),$a(),Ra(),Fa(),Da(),Pa(),$e()}}),Fs={};q(Fs,{CheckRepoActions:()=>Tr,checkIsBareRepoTask:()=>Ds,checkIsRepoRootTask:()=>Ms,checkIsRepoTask:()=>Ia});function Ia(e){switch(e){case"bare":return Ds();case"root":return Ms()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:Fe,parser:Br}}function Ms(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:Fe,parser(t){return/^\.(git)?$/.test(t.trim())}}}function Ds(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:Fe,parser:Br}}function La(e){return/(Not a git repository|Kein Git-Repository)/i.test(String(e))}var Tr,Fe,Br,Ps=d({"src/lib/tasks/check-is-repo.ts"(){"use strict";O(),Tr=(e=>(e.BARE="bare",e.IN_TREE="tree",e.IS_REPO_ROOT="root",e))(Tr||{}),Fe=({exitCode:e},t,r,n)=>{if(e===128&&La(t))return r(Buffer.from("false"));n(t)},Br=e=>e.trim()==="true"}});function ja(e,t){let r=new Is(e),n=e?js:Ls;return ee(t).forEach(s=>{let i=s.replace(n,"");r.paths.push(i),(Ns.test(i)?r.folders:r.files).push(i)}),r}var Is,Ls,js,Ns,Na=d({"src/lib/responses/CleanSummary.ts"(){"use strict";O(),Is=class{constructor(e){this.dryRun=e,this.paths=[],this.files=[],this.folders=[]}},Ls=/^[a-z]+\s*/i,js=/^[a-z]+\s+[a-z]+\s*/i,Ns=/\/$/}}),xr={};q(xr,{EMPTY_COMMANDS:()=>Me,adhocExecTask:()=>Hs,configurationErrorTask:()=>ct,isBufferTask:()=>Gs,isEmptyTask:()=>Vs,straightThroughBufferTask:()=>Bs,straightThroughStringTask:()=>it});function Hs(e){return{commands:Me,format:"empty",parser:e}}function ct(e){return{commands:Me,format:"empty",parser(){throw typeof e=="string"?new ms(e):e}}}function it(e,t=!1){return{commands:e,format:"utf-8",parser(r){return t?String(r).trim():r}}}function Bs(e){return{commands:e,format:"buffer",parser(t){return t}}}function Gs(e){return e.format==="buffer"}function Vs(e){return e.format==="empty"||!e.commands.length}var Me,W=d({"src/lib/tasks/task.ts"(){"use strict";ds(),Me=[]}}),Ws={};q(Ws,{CONFIG_ERROR_INTERACTIVE_MODE:()=>Gr,CONFIG_ERROR_MODE_REQUIRED:()=>Vr,CONFIG_ERROR_UNKNOWN_OPTION:()=>Wr,CleanOptions:()=>be,cleanTask:()=>qs,cleanWithOptionsTask:()=>Ha,isCleanOptionsArray:()=>Ba});function Ha(e,t){let{cleanMode:r,options:n,valid:s}=Ga(e);return r?s.options?(n.push(...t),n.some(qa)?ct(Gr):qs(r,n)):ct(Wr+JSON.stringify(e)):ct(Vr)}function qs(e,t){return{commands:["clean",`-${e}`,...t],format:"utf-8",parser(n){return ja(e==="n",n)}}}function Ba(e){return Array.isArray(e)&&e.every(t=>qr.has(t))}function Ga(e){let t,r=[],n={cleanMode:!1,options:!0};return e.replace(/[^a-z]i/g,"").split("").forEach(s=>{Va(s)?(t=s,n.cleanMode=!0):n.options=n.options&&Wa(r[r.length]=`-${s}`)}),{cleanMode:t,options:r,valid:n}}function Va(e){return e==="f"||e==="n"}function Wa(e){return/^-[a-z]$/i.test(e)&&qr.has(e.charAt(1))}function qa(e){return/^-[^\-]/.test(e)?e.indexOf("i")>0:e==="--interactive"}var Gr,Vr,Wr,be,qr,Us=d({"src/lib/tasks/clean.ts"(){"use strict";Na(),O(),W(),Gr="Git clean interactive mode is not supported",Vr='Git clean mode parameter ("n" or "f") is required',Wr="Git clean unknown option found in: ",be=(e=>(e.DRY_RUN="n",e.FORCE="f",e.IGNORED_INCLUDED="x",e.IGNORED_ONLY="X",e.EXCLUDING="e",e.QUIET="q",e.RECURSIVE="d",e))(be||{}),qr=new Set(["i",...ks(Object.values(be))])}});function Ua(e){let t=new Ys;for(let r of zs(e))t.addValue(r.file,String(r.key),r.value);return t}function za(e,t){let r=null,n=[],s=new Map;for(let i of zs(e,t))i.key===t&&(n.push(r=i.value),s.has(i.file)||s.set(i.file,[]),s.get(i.file).push(r));return{key:t,paths:Array.from(s.keys()),scopes:s,value:r,values:n}}function Ya(e){return e.replace(/^(file):/,"")}function*zs(e,t=null){let r=e.split("\0");for(let n=0,s=r.length-1;n<s;){let i=Ya(r[n++]),o=r[n++],a=t;if(o.includes(`
33
33
  `)){let l=bs(o,`
34
34
  `);a=l[0],o=l[1]}yield{file:i,key:a,value:o}}}var Ys,Ja=d({"src/lib/responses/ConfigList.ts"(){"use strict";O(),Ys=class{constructor(){this.files=[],this.values=Object.create(null)}get all(){return this._all||(this._all=this.files.reduce((e,t)=>Object.assign(e,this.values[t]),{})),this._all}addFile(e){if(!(e in this.values)){let t=Lt(this.files);this.values[e]=t?Object.create(this.values[t]):{},this.files.push(e)}return this.values[e]}addValue(e,t,r){let n=this.addFile(e);n.hasOwnProperty(t)?Array.isArray(n[t])?n[t].push(r):n[t]=[n[t],r]:n[t]=r,this._all=void 0}}}});function mr(e,t){return typeof e=="string"&&Sr.hasOwnProperty(e)?e:t}function Ka(e,t,r,n){let s=["config",`--${n}`];return r&&s.push("--add"),s.push(e,t),{commands:s,format:"utf-8",parser(i){return i}}}function Qa(e,t){let r=["config","--null","--show-origin","--get-all",e];return t&&r.splice(1,0,`--${t}`),{commands:r,format:"utf-8",parser(n){return za(n,e)}}}function Za(e){let t=["config","--list","--show-origin","--null"];return e&&t.push(`--${e}`),{commands:t,format:"utf-8",parser(r){return Ua(r)}}}function Xa(){return{addConfig(e,t,...r){return this._runTask(Ka(e,t,r[0]===!0,mr(r[1],"local")),V(arguments))},getConfig(e,t){return this._runTask(Qa(e,mr(t,void 0)),V(arguments))},listConfig(...e){return this._runTask(Za(mr(e[0],void 0)),V(arguments))}}}var Sr,Js=d({"src/lib/tasks/config.ts"(){"use strict";Ja(),O(),Sr=(e=>(e.system="system",e.global="global",e.local="local",e.worktree="worktree",e))(Sr||{})}});function tu(e){return Ks.has(e)}var dr,Ks,Qs=d({"src/lib/tasks/diff-name-status.ts"(){"use strict";dr=(e=>(e.ADDED="A",e.COPIED="C",e.DELETED="D",e.MODIFIED="M",e.RENAMED="R",e.CHANGED="T",e.UNMERGED="U",e.UNKNOWN="X",e.BROKEN="B",e))(dr||{}),Ks=new Set(Object.values(dr))}});function eu(...e){return new Xs().param(...e)}function ru(e){let t=new Set,r={};return Ir(e,n=>{let[s,i,o]=n.split(Ut);t.add(s),(r[s]=r[s]||[]).push({line:L(i),path:s,preview:o})}),{paths:t,results:r}}function nu(){return{grep(e){let t=V(arguments),r=ut(arguments);for(let s of Zs)if(r.includes(s))return this._runTask(ct(`git.grep: use of "${s}" is not supported.`),t);typeof e=="string"&&(e=eu().param(e));let n=["grep","--null","-n","--full-name",...r,...e];return this._runTask({commands:n,format:"utf-8",parser(s){return ru(s)}},t)}}}var Zs,Kt,jn,Xs,ti=d({"src/lib/tasks/grep.ts"(){"use strict";O(),W(),Zs=["-h"],Kt=Symbol("grepQuery"),Xs=class{constructor(){this[jn]=[]}*[(jn=Kt,Symbol.iterator)](){for(let e of this[Kt])yield e}and(...e){return e.length&&this[Kt].push("--and","(",...Qt(e,"-e"),")"),this}param(...e){return this[Kt].push(...Qt(e,"-e")),this}}}}),ei={};q(ei,{ResetMode:()=>ye,getResetMode:()=>iu,resetTask:()=>su});function su(e,t){let r=["reset"];return ri(e)&&r.push(`--${e}`),r.push(...t),it(r)}function iu(e){if(ri(e))return e;switch(typeof e){case"string":case"undefined":return"soft"}}function ri(e){return ni.includes(e)}var ye,ni,si=d({"src/lib/tasks/reset.ts"(){"use strict";W(),ye=(e=>(e.MIXED="mixed",e.SOFT="soft",e.HARD="hard",e.MERGE="merge",e.KEEP="keep",e))(ye||{}),ni=Array.from(Object.values(ye))}});function ou(){return(0,Te.default)("simple-git")}function Nn(e,t,r){return!t||!String(t).replace(/\s*/,"")?r?(n,...s)=>{e(n,...s),r(n,...s)}:e:(n,...s)=>{e(`%s ${n}`,t,...s),r&&r(n,...s)}}function au(e,t,{namespace:r}){if(typeof e=="string")return e;let n=t&&t.namespace||"";return n.startsWith(r)?n.substr(r.length+1):n||r}function Ur(e,t,r,n=ou()){let s=e&&`[${e}]`||"",i=[],o=typeof t=="string"?n.extend(t):t,a=au(vt(t,et),o,n);return h(r);function l(u,c){return $(i,Ur(e,a.replace(/^[^:]+/,u),c,n))}function h(u){let c=u&&`[${u}]`||"",f=o&&Nn(o,c)||jt,p=Nn(n,`${s} ${c}`,f);return Object.assign(o?f:p,{label:e,sibling:l,info:p,step:h})}}var ii=d({"src/lib/git-logger.ts"(){"use strict";O(),Te.default.formatters.L=e=>String(jr(e)?e.length:"-"),Te.default.formatters.B=e=>Buffer.isBuffer(e)?e.toString("utf8"):re(e)}}),oi,uu=d({"src/lib/runners/tasks-pending-queue.ts"(){"use strict";Rt(),ii(),oi=class Ar{constructor(t="GitExecutor"){this.logLabel=t,this._queue=new Map}withProgress(t){return this._queue.get(t)}createProgress(t){let r=Ar.getName(t.commands[0]),n=Ur(this.logLabel,r);return{task:t,logger:n,name:r}}push(t){let r=this.createProgress(t);return r.logger("Adding task to the queue, commands = %o",t.commands),this._queue.set(t,r),r}fatal(t){for(let[r,{logger:n}]of Array.from(this._queue.entries()))r===t.task?(n.info("Failed %o",t),n("Fatal exception, any as-yet un-started tasks run through this executor will not be attempted")):n.info("A fatal exception occurred in a previous task, the queue has been purged: %o",t.message),this.complete(r);if(this._queue.size!==0)throw new Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(t){this.withProgress(t)&&this._queue.delete(t)}attempt(t){let r=this.withProgress(t);if(!r)throw new At(void 0,"TasksPendingQueue: attempt called for an unknown task");return r.logger("Starting task"),r}static getName(t="empty"){return`task:${t}:${++Ar.counter}`}static{this.counter=0}}}});function It(e,t){return{method:ys(e.commands)||"",commands:t}}function lu(e,t){return r=>{t("[ERROR] child process exception %o",r),e.push(Buffer.from(String(r.stack),"ascii"))}}function Hn(e,t,r,n){return s=>{r("%s received %L bytes",t,s),n("%B",s),e.push(s)}}var Er,hu=d({"src/lib/runners/git-executor-chain.ts"(){"use strict";Rt(),W(),O(),uu(),Er=class{constructor(e,t,r){this._executor=e,this._scheduler=t,this._plugins=r,this._chain=Promise.resolve(),this._queue=new oi}get cwd(){return this._cwd||this._executor.cwd}set cwd(e){this._cwd=e}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(e){return this._queue.push(e),this._chain=this._chain.then(()=>this.attemptTask(e))}async attemptTask(e){let t=await this._scheduler.next(),r=()=>this._queue.complete(e);try{let{logger:n}=this._queue.attempt(e);return await(Vs(e)?this.attemptEmptyTask(e,n):this.attemptRemoteTask(e,n))}catch(n){throw this.onFatalException(e,n)}finally{r(),t()}}onFatalException(e,t){let r=t instanceof At?Object.assign(t,{task:e}):new At(e,t&&String(t));return this._chain=Promise.resolve(),this._queue.fatal(r),r}async attemptRemoteTask(e,t){let r=this._plugins.exec("spawn.binary","",It(e,e.commands)),n=this._plugins.exec("spawn.args",[...e.commands],It(e,e.commands)),s=await this.gitResponse(e,r,n,this.outputHandler,t.step("SPAWN")),i=await this.handleTaskData(e,n,s,t.step("HANDLE"));return t("passing response to task's parser as a %s",e.format),Gs(e)?Or(e.parser,i):Or(e.parser,i.asStrings())}async attemptEmptyTask(e,t){return t("empty task bypassing child process to call to task's parser"),e.parser(this)}handleTaskData(e,t,r,n){let{exitCode:s,rejection:i,stdOut:o,stdErr:a}=r;return new Promise((l,h)=>{n("Preparing to handle process response exitCode=%d stdOut=",s);let{error:u}=this._plugins.exec("task.error",{error:i},{...It(e,t),...r});if(u&&e.onError)return n.info("exitCode=%s handling with custom error handler"),e.onError(r,u,c=>{n.info("custom error handler treated as success"),n("custom error returned a %s",re(c)),l(new Oe(Array.isArray(c)?Buffer.concat(c):c,Buffer.concat(a)))},h);if(u)return n.info("handling as error: exitCode=%s stdErr=%s rejection=%o",s,a.length,i),h(u);n.info("retrieving task output complete"),l(new Oe(Buffer.concat(o),Buffer.concat(a)))})}async gitResponse(e,t,r,n,s){let i=s.sibling("output"),o=this._plugins.exec("spawn.options",{cwd:this.cwd,env:this.env,windowsHide:!0},It(e,e.commands));return new Promise(a=>{let l=[],h=[];s.info("%s %o",t,r),s("%O",o);let u=this._beforeSpawn(e,r);if(u)return a({stdOut:l,stdErr:h,exitCode:9901,rejection:u});this._plugins.exec("spawn.before",void 0,{...It(e,r),kill(f){u=f||u}});let c=cu(t,r,o);c.stdout.on("data",Hn(l,"stdOut",s,i.step("stdOut"))),c.stderr.on("data",Hn(h,"stdErr",s,i.step("stdErr"))),c.on("error",lu(h,s)),n&&(s("Passing child process stdOut/stdErr to custom outputHandler"),n(t,c.stdout,c.stderr,[...r])),this._plugins.exec("spawn.after",void 0,{...It(e,r),spawned:c,close(f,p){a({stdOut:l,stdErr:h,exitCode:f,rejection:u||p})},kill(f){c.killed||(u=f,c.kill("SIGINT"))}})})}_beforeSpawn(e,t){let r;return this._plugins.exec("spawn.before",void 0,{...It(e,t),kill(n){r=n||r}}),r}}}}),ai={};q(ai,{GitExecutor:()=>ui});var ui,fu=d({"src/lib/runners/git-executor.ts"(){"use strict";hu(),ui=class{constructor(e,t,r){this.cwd=e,this._scheduler=t,this._plugins=r,this._chain=new Er(this,this._scheduler,this._plugins)}chain(){return new Er(this,this._scheduler,this._plugins)}push(e){return this._chain.push(e)}}}});function pu(e,t,r=jt){let n=i=>{r(null,i)},s=i=>{i?.task===e&&r(i instanceof te?mu(i):i,void 0)};t.then(n,s)}function mu(e){let t=n=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${n} should be GitResponseError.git.${n}, this will no longer be available in version 3`),t=jt};return Object.create(e,Object.getOwnPropertyNames(e.git).reduce(r,{}));function r(n,s){return s in e||(n[s]={enumerable:!1,configurable:!1,get(){return t(s),e.git[s]}}),n}}var du=d({"src/lib/task-callback.ts"(){"use strict";zt(),O()}});function Bn(e,t){return Hs(r=>{if(!Lr(e))throw new Error(`Git.cwd: cannot change to non-directory "${e}"`);return(t||r).cwd=e})}var gu=d({"src/lib/tasks/change-working-directory.ts"(){"use strict";O(),W()}});function gr(e){let t=["checkout",...e];return t[1]==="-b"&&t.includes("-B")&&(t[1]=Ee(t,"-B")),it(t)}function _u(){return{checkout(){return this._runTask(gr(ut(arguments,1)),V(arguments))},checkoutBranch(e,t){return this._runTask(gr(["-b",e,t,...ut(arguments)]),V(arguments))},checkoutLocalBranch(e){return this._runTask(gr(["-b",e,...ut(arguments)]),V(arguments))}}}var bu=d({"src/lib/tasks/checkout.ts"(){"use strict";O(),W()}});function yu(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}function vu(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser(e){return lt(yu(),[ci],e)}})}}}var ci,Cu=d({"src/lib/tasks/count-objects.ts"(){"use strict";O(),ci=new S(/([a-z-]+): (\d+)$/,(e,[t,r])=>{let n=ws(t);e.hasOwnProperty(n)&&(e[n]=L(r))})}});function wu(e){return lt({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},li,e)}var li,ku=d({"src/lib/parsers/parse-commit.ts"(){"use strict";O(),li=[new S(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(e,[t,r,n])=>{e.branch=t,e.commit=n,e.root=!!r}),new S(/\s*Author:\s(.+)/i,(e,[t])=>{let r=t.split("<"),n=r.pop();!n||!n.includes("@")||(e.author={email:n.substr(0,n.length-1),name:r.join("<").trim()})}),new S(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(e,[t,r,n])=>{e.summary.changes=parseInt(t,10)||0,e.summary.insertions=parseInt(r,10)||0,e.summary.deletions=parseInt(n,10)||0}),new S(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(e,[t,r,n])=>{e.summary.changes=parseInt(t,10)||0;let s=parseInt(r,10)||0;n==="-"?e.summary.deletions=s:n==="+"&&(e.summary.insertions=s)})]}});function Ou(e,t,r){return{commands:["-c","core.abbrev=40","commit",...Qt(e,"-m"),...t,...r],format:"utf-8",parser:wu}}function Tu(){return{commit(t,...r){let n=V(arguments),s=e(t)||Ou(yt(t),yt(vt(r[0],ke,[])),[...vt(r[1],ne,[]),...ut(arguments,0,!0)]);return this._runTask(s,n)}};function e(t){return!ke(t)&&ct("git.commit: requires the commit message to be supplied as a string/string[]")}}var xu=d({"src/lib/tasks/commit.ts"(){"use strict";ku(),O(),W()}});function Su(){return{firstCommit(){return this._runTask(it(["rev-list","--max-parents=0","HEAD"],!0),V(arguments))}}}var Au=d({"src/lib/tasks/first-commit.ts"(){"use strict";O(),W()}});function Eu(e,t){let r=["hash-object",e];return t&&r.push("-w"),it(r,!0)}var $u=d({"src/lib/tasks/hash-object.ts"(){"use strict";W()}});function Ru(e,t,r){let n=String(r).trim(),s;if(s=hi.exec(n))return new ve(e,t,!1,s[1]);if(s=fi.exec(n))return new ve(e,t,!0,s[1]);let i="",o=n.split(" ");for(;o.length;)if(o.shift()==="in"){i=o.join(" ");break}return new ve(e,t,/^re/i.test(n),i)}var ve,hi,fi,Fu=d({"src/lib/responses/InitSummary.ts"(){"use strict";ve=class{constructor(e,t,r,n){this.bare=e,this.path=t,this.existing=r,this.gitDir=n}},hi=/^Init.+ repository in (.+)$/,fi=/^Rein.+ in (.+)$/}});function Mu(e){return e.includes(zr)}function Du(e=!1,t,r){let n=["init",...r];return e&&!Mu(n)&&n.splice(1,0,zr),{commands:n,format:"utf-8",parser(s){return Ru(n.includes("--bare"),t,s)}}}var zr,Pu=d({"src/lib/tasks/init.ts"(){"use strict";Fu(),zr="--bare"}});function Yr(e){for(let t=0;t<e.length;t++){let r=Jr.exec(e[t]);if(r)return`--${r[1]}`}return""}function Iu(e){return Jr.test(e)}var Jr,se=d({"src/lib/args/log-format.ts"(){"use strict";Jr=/^--(stat|numstat|name-only|name-status)(=|$)/}}),pi,Lu=d({"src/lib/responses/DiffSummary.ts"(){"use strict";pi=class{constructor(){this.changed=0,this.deletions=0,this.insertions=0,this.files=[]}}}});function mi(e=""){let t=di[e];return r=>lt(new pi,t,r,!1)}var _r,Gn,Vn,Wn,di,gi=d({"src/lib/parsers/parse-diff-summary.ts"(){"use strict";se(),Lu(),Qs(),O(),_r=[new S(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(e,[t,r,n=""])=>{e.files.push({file:t.trim(),changes:L(r),insertions:n.replace(/[^+]/g,"").length,deletions:n.replace(/[^-]/g,"").length,binary:!1})}),new S(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(e,[t,r,n])=>{e.files.push({file:t.trim(),before:L(r),after:L(n),binary:!0})}),new S(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(e,[t,r])=>{let n=/(\d+) i/.exec(r),s=/(\d+) d/.exec(r);e.changed=L(t),e.insertions=L(n?.[1]),e.deletions=L(s?.[1])})],Gn=[new S(/(\d+)\t(\d+)\t(.+)$/,(e,[t,r,n])=>{let s=L(t),i=L(r);e.changed++,e.insertions+=s,e.deletions+=i,e.files.push({file:n,changes:s+i,insertions:s,deletions:i,binary:!1})}),new S(/-\t-\t(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,after:0,before:0,binary:!0})})],Vn=[new S(/(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,changes:0,insertions:0,deletions:0,binary:!1})})],Wn=[new S(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(e,[t,r,n,s,i])=>{e.changed++,e.files.push({file:i??n,changes:0,insertions:0,deletions:0,binary:!1,status:Cr(tu(t)&&t),from:Cr(!!i&&n!==i&&n),similarity:L(r)})})],di={"":_r,"--stat":_r,"--numstat":Gn,"--name-status":Wn,"--name-only":Vn}}});function ju(e,t){return t.reduce((r,n,s)=>(r[n]=e[s]||"",r),Object.create({diff:null}))}function _i(e=Zr,t=bi,r=""){let n=mi(r);return function(s){let i=ee(s.trim(),!1,Kr).map(function(o){let a=o.split(Qr),l=ju(a[0].split(e),t);return a.length>1&&a[1].trim()&&(l.diff=n(a[1])),l});return{all:i,latest:i.length&&i[0]||null,total:i.length}}}var Kr,Qr,Zr,bi,yi=d({"src/lib/parsers/parse-list-log-summary.ts"(){"use strict";O(),gi(),se(),Kr="\xF2\xF2\xF2\xF2\xF2\xF2 ",Qr=" \xF2\xF2",Zr=" \xF2 ",bi=["hash","date","message","refs","author_name","author_email"]}}),vi={};q(vi,{diffSummaryTask:()=>Nu,validateLogFormatConfig:()=>De});function Nu(e){let t=Yr(e),r=["diff"];return t===""&&(t="--stat",r.push("--stat=4096")),r.push(...e),De(r)||{commands:r,format:"utf-8",parser:mi(t)}}function De(e){let t=e.filter(Iu);if(t.length>1)return ct(`Summary flags are mutually exclusive - pick one of ${t.join(",")}`);if(t.length&&e.includes("-z"))return ct(`Summary flag ${t} parsing is not compatible with null termination option '-z'`)}var Xr=d({"src/lib/tasks/diff.ts"(){"use strict";se(),gi(),W()}});function Hu(e,t){let r=[],n=[];return Object.keys(e).forEach(s=>{r.push(s),n.push(String(e[s]))}),[r,n.join(t)]}function Bu(e){return Object.keys(e).reduce((t,r)=>(r in $r||(t[r]=e[r]),t),{})}function Ci(e={},t=[]){let r=vt(e.splitter,et,Zr),n=Re(e.format)?e.format:{hash:"%H",date:e.strictDate===!1?"%ai":"%aI",message:"%s",refs:"%D",body:e.multiLine?"%B":"%b",author_name:e.mailMap!==!1?"%aN":"%an",author_email:e.mailMap!==!1?"%aE":"%ae"},[s,i]=Hu(n,r),o=[],a=[`--pretty=format:${Kr}${i}${Qr}`,...t],l=e.n||e["max-count"]||e.maxCount;if(l&&a.push(`--max-count=${l}`),e.from||e.to){let h=e.symmetric!==!1?"...":"..";o.push(`${e.from||""}${h}${e.to||""}`)}return et(e.file)&&a.push("--follow",Sa(e.file)),Nr(Bu(e),a),{fields:s,splitter:r,commands:[...a,...o]}}function Gu(e,t,r){let n=_i(e,t,Yr(r));return{commands:["log",...r],format:"utf-8",parser:n}}function Vu(){return{log(...r){let n=V(arguments),s=Ci(Hr(arguments),vt(arguments[0],ne)),i=t(...r)||De(s.commands)||e(s);return this._runTask(i,n)}};function e(r){return Gu(r.splitter,r.fields,r.commands)}function t(r,n){return et(r)&&et(n)&&ct("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}}var $r,wi=d({"src/lib/tasks/log.ts"(){"use strict";se(),Xt(),yi(),O(),W(),Xr(),$r=(e=>(e[e["--pretty"]=0]="--pretty",e[e["max-count"]=1]="max-count",e[e.maxCount=2]="maxCount",e[e.n=3]="n",e[e.file=4]="file",e[e.format=5]="format",e[e.from=6]="from",e[e.to=7]="to",e[e.splitter=8]="splitter",e[e.symmetric=9]="symmetric",e[e.mailMap=10]="mailMap",e[e.multiLine=11]="multiLine",e[e.strictDate=12]="strictDate",e))($r||{})}}),Ce,ki,Wu=d({"src/lib/responses/MergeSummary.ts"(){"use strict";Ce=class{constructor(e,t=null,r){this.reason=e,this.file=t,this.meta=r}toString(){return`${this.file}:${this.reason}`}},ki=class{constructor(){this.conflicts=[],this.merges=[],this.result="success"}get failed(){return this.conflicts.length>0}get reason(){return this.result}toString(){return this.conflicts.length?`CONFLICTS: ${this.conflicts.join(", ")}`:"OK"}}}}),Rr,Oi,qu=d({"src/lib/responses/PullSummary.ts"(){"use strict";Rr=class{constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},Oi=class{constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function br(e){return e.objects=e.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}function qn(e){let t=/^\s*(\d+)/.exec(e),r=/delta (\d+)/i.exec(e);return{count:L(t&&t[1]||"0"),delta:L(r&&r[1]||"0")}}var Ti,Uu=d({"src/lib/parsers/parse-remote-objects.ts"(){"use strict";O(),Ti=[new $t(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(e,[t,r])=>{let n=t.toLowerCase(),s=br(e.remoteMessages);Object.assign(s,{[n]:L(r)})}),new $t(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(e,[t,r])=>{let n=t.toLowerCase(),s=br(e.remoteMessages);Object.assign(s,{[n]:L(r)})}),new $t(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(e,[t,r,n])=>{let s=br(e.remoteMessages);s.total=qn(t),s.reused=qn(r),s.packReused=L(n)})]}});function xi(e,t){return lt({remoteMessages:new Ai},Si,t)}var Si,Ai,Ei=d({"src/lib/parsers/parse-remote-messages.ts"(){"use strict";O(),Uu(),Si=[new $t(/^remote:\s*(.+)$/,(e,[t])=>(e.remoteMessages.all.push(t.trim()),!1)),...Ti,new $t([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(e,[t])=>{e.remoteMessages.pullRequestUrl=t}),new $t([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(e,[t,r,n])=>{e.remoteMessages.vulnerabilities={count:L(t),summary:r,url:n}})],Ai=class{constructor(){this.all=[]}}}});function zu(e,t){let r=lt(new Oi,$i,[e,t]);return r.message&&r}var Un,zn,Yn,Jn,$i,Kn,tn,Ri=d({"src/lib/parsers/parse-pull.ts"(){"use strict";qu(),O(),Ei(),Un=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,zn=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,Yn=/^(create|delete) mode \d+ (.+)/,Jn=[new S(Un,(e,[t,r,n])=>{e.files.push(t),r&&(e.insertions[t]=r.length),n&&(e.deletions[t]=n.length)}),new S(zn,(e,[t,,r,,n])=>r!==void 0||n!==void 0?(e.summary.changes=+t||0,e.summary.insertions=+r||0,e.summary.deletions=+n||0,!0):!1),new S(Yn,(e,[t,r])=>{$(e.files,r),$(t==="create"?e.created:e.deleted,r)})],$i=[new S(/^from\s(.+)$/i,(e,[t])=>void(e.remote=t)),new S(/^fatal:\s(.+)$/,(e,[t])=>void(e.message=t)),new S(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(e,[t,r,n,s])=>{e.branch.local=n,e.hash.local=t,e.branch.remote=s,e.hash.remote=r})],Kn=(e,t)=>lt(new Rr,Jn,[e,t]),tn=(e,t)=>Object.assign(new Rr,Kn(e,t),xi(e,t))}}),Qn,Fi,Zn,Yu=d({"src/lib/parsers/parse-merge.ts"(){"use strict";Wu(),O(),Ri(),Qn=[new S(/^Auto-merging\s+(.+)$/,(e,[t])=>{e.merges.push(t)}),new S(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(e,[t,r])=>{e.conflicts.push(new Ce(t,r))}),new S(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(e,[t,r,n])=>{e.conflicts.push(new Ce(t,r,{deleteRef:n}))}),new S(/^CONFLICT\s+\((.+)\):/,(e,[t])=>{e.conflicts.push(new Ce(t,null))}),new S(/^Automatic merge failed;\s+(.+)$/,(e,[t])=>{e.result=t})],Fi=(e,t)=>Object.assign(Zn(e,t),tn(e,t)),Zn=e=>lt(new ki,Qn,e)}});function Xn(e){return e.length?{commands:["merge",...e],format:"utf-8",parser(t,r){let n=Fi(t,r);if(n.failed)throw new te(n);return n}}:ct("Git.merge requires at least one option")}var Ju=d({"src/lib/tasks/merge.ts"(){"use strict";zt(),Yu(),W()}});function Ku(e,t,r){let n=r.includes("deleted"),s=r.includes("tag")||/^refs\/tags/.test(e),i=!r.includes("new");return{deleted:n,tag:s,branch:!s,new:!i,alreadyUpdated:i,local:e,remote:t}}var ts,Mi,es,Qu=d({"src/lib/parsers/parse-push.ts"(){"use strict";O(),Ei(),ts=[new S(/^Pushing to (.+)$/,(e,[t])=>{e.repo=t}),new S(/^updating local tracking ref '(.+)'/,(e,[t])=>{e.ref={...e.ref||{},local:t}}),new S(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(e,[t,r,n])=>{e.pushed.push(Ku(t,r,n))}),new S(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(e,[t,r,n])=>{e.branch={...e.branch||{},local:t,remote:r,remoteName:n}}),new S(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(e,[t,r,n,s])=>{e.update={head:{local:t,remote:r},hash:{from:n,to:s}}})],Mi=(e,t)=>{let r=es(e,t),n=xi(e,t);return{...r,...n}},es=(e,t)=>lt({pushed:[]},ts,[e,t])}}),Di={};q(Di,{pushTagsTask:()=>Zu,pushTask:()=>en});function Zu(e={},t){return $(t,"--tags"),en(e,t)}function en(e={},t){let r=["push",...t];return e.branch&&r.splice(1,0,e.branch),e.remote&&r.splice(1,0,e.remote),Ee(r,"-v"),$(r,"--verbose"),$(r,"--porcelain"),{commands:r,format:"utf-8",parser:Mi}}var Pi=d({"src/lib/tasks/push.ts"(){"use strict";Qu(),O()}});function Xu(){return{showBuffer(){let e=["show",...ut(arguments,1)];return e.includes("--binary")||e.splice(1,0,"--binary"),this._runTask(Bs(e),V(arguments))},show(){let e=["show",...ut(arguments,1)];return this._runTask(it(e),V(arguments))}}}var tc=d({"src/lib/tasks/show.ts"(){"use strict";O(),W()}}),rs,Ii,ec=d({"src/lib/responses/FileStatusSummary.ts"(){"use strict";rs=/^(.+)\0(.+)$/,Ii=class{constructor(e,t,r){if(this.path=e,this.index=t,this.working_dir=r,t==="R"||r==="R"){let n=rs.exec(e)||[null,e,e];this.from=n[2]||"",this.path=n[1]||""}}}}});function ns(e){let[t,r]=e.split(Ut);return{from:r||t,to:t}}function pt(e,t,r){return[`${e}${t}`,r]}function yr(e,...t){return t.map(r=>pt(e,r,(n,s)=>$(n.conflicted,s)))}function rc(e,t){let r=t.trim();switch(" "){case r.charAt(2):return n(r.charAt(0),r.charAt(1),r.substr(3));case r.charAt(1):return n(" ",r.charAt(0),r.substr(2));default:return}function n(s,i,o){let a=`${s}${i}`,l=Li.get(a);l&&l(e,o),a!=="##"&&a!=="!!"&&e.files.push(new Ii(o,s,i))}}var ss,Li,ji,nc=d({"src/lib/responses/StatusSummary.ts"(){"use strict";O(),ec(),ss=class{constructor(){this.not_added=[],this.conflicted=[],this.created=[],this.deleted=[],this.ignored=void 0,this.modified=[],this.renamed=[],this.files=[],this.staged=[],this.ahead=0,this.behind=0,this.current=null,this.tracking=null,this.detached=!1,this.isClean=()=>!this.files.length}},Li=new Map([pt(" ","A",(e,t)=>$(e.created,t)),pt(" ","D",(e,t)=>$(e.deleted,t)),pt(" ","M",(e,t)=>$(e.modified,t)),pt("A"," ",(e,t)=>$(e.created,t)&&$(e.staged,t)),pt("A","M",(e,t)=>$(e.created,t)&&$(e.staged,t)&&$(e.modified,t)),pt("D"," ",(e,t)=>$(e.deleted,t)&&$(e.staged,t)),pt("M"," ",(e,t)=>$(e.modified,t)&&$(e.staged,t)),pt("M","M",(e,t)=>$(e.modified,t)&&$(e.staged,t)),pt("R"," ",(e,t)=>{$(e.renamed,ns(t))}),pt("R","M",(e,t)=>{let r=ns(t);$(e.renamed,r),$(e.modified,r.to)}),pt("!","!",(e,t)=>{$(e.ignored=e.ignored||[],t)}),pt("?","?",(e,t)=>$(e.not_added,t)),...yr("A","A","U"),...yr("D","D","U"),...yr("U","A","D","U"),["##",(e,t)=>{let r=/ahead (\d+)/,n=/behind (\d+)/,s=/^(.+?(?=(?:\.{3}|\s|$)))/,i=/\.{3}(\S*)/,o=/\son\s([\S]+)$/,a;a=r.exec(t),e.ahead=a&&+a[1]||0,a=n.exec(t),e.behind=a&&+a[1]||0,a=s.exec(t),e.current=a&&a[1],a=i.exec(t),e.tracking=a&&a[1],a=o.exec(t),e.current=a&&a[1]||e.current,e.detached=/\(no branch\)/.test(t)}]]),ji=function(e){let t=e.split(Ut),r=new ss;for(let n=0,s=t.length;n<s;){let i=t[n++].trim();i&&(i.charAt(0)==="R"&&(i+=Ut+(t[n++]||"")),rc(r,i))}return r}}});function sc(e){return{format:"utf-8",commands:["status","--porcelain","-b","-u","--null",...e.filter(r=>!Ni.includes(r))],parser(r){return ji(r)}}}var Ni,ic=d({"src/lib/tasks/status.ts"(){"use strict";nc(),Ni=["--null","-z"]}});function xe(e=0,t=0,r=0,n="",s=!0){return Object.defineProperty({major:e,minor:t,patch:r,agent:n,installed:s},"toString",{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}function oc(){return xe(0,0,0,"",!1)}function ac(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:uc,onError(e,t,r,n){if(e.exitCode===-2)return r(Buffer.from(rn));n(t)}})}}}function uc(e){return e===rn?oc():lt(xe(0,0,0,e),Hi,e)}var rn,Hi,cc=d({"src/lib/tasks/version.ts"(){"use strict";O(),rn="installed=false",Hi=[new S(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(e,[t,r,n,s=""])=>{Object.assign(e,xe(L(t),L(r),L(n),s))}),new S(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(e,[t,r,n,s=""])=>{Object.assign(e,xe(L(t),L(r),n,s))})]}}),Bi={};q(Bi,{SimpleGitApi:()=>Fr});var Fr,lc=d({"src/lib/simple-git-api.ts"(){"use strict";du(),gu(),bu(),Cu(),xu(),Js(),Au(),ti(),$u(),Pu(),wi(),Ju(),Pi(),tc(),ic(),W(),cc(),O(),Fr=class{constructor(e){this._executor=e}_runTask(e,t){let r=this._executor.chain(),n=r.push(e);return t&&pu(e,n,t),Object.create(this,{then:{value:n.then.bind(n)},catch:{value:n.catch.bind(n)},_executor:{value:r}})}add(e){return this._runTask(it(["add",...yt(e)]),V(arguments))}cwd(e){let t=V(arguments);return typeof e=="string"?this._runTask(Bn(e,this._executor),t):typeof e?.path=="string"?this._runTask(Bn(e.path,e.root&&this._executor||void 0),t):this._runTask(ct("Git.cwd: workingDirectory must be supplied as a string"),t)}hashObject(e,t){return this._runTask(Eu(e,t===!0),V(arguments))}init(e){return this._runTask(Du(e===!0,this._executor.cwd,ut(arguments)),V(arguments))}merge(){return this._runTask(Xn(ut(arguments)),V(arguments))}mergeFromTo(e,t){return et(e)&&et(t)?this._runTask(Xn([e,t,...ut(arguments)]),V(arguments,!1)):this._runTask(ct("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"))}outputHandler(e){return this._executor.outputHandler=e,this}push(){let e=en({remote:vt(arguments[0],et),branch:vt(arguments[1],et)},ut(arguments));return this._runTask(e,V(arguments))}stash(){return this._runTask(it(["stash",...ut(arguments)]),V(arguments))}status(){return this._runTask(sc(ut(arguments)),V(arguments))}},Object.assign(Fr.prototype,_u(),Tu(),Xa(),vu(),Su(),nu(),Vu(),Xu(),ac())}}),Gi={};q(Gi,{Scheduler:()=>Wi});var is,Wi,hc=d({"src/lib/runners/scheduler.ts"(){"use strict";O(),ii(),is=(()=>{let e=0;return()=>{e++;let{promise:t,done:r}=(0,Vi.createDeferred)();return{promise:t,done:r,id:e}}})(),Wi=class{constructor(e=2){this.concurrency=e,this.logger=Ur("","scheduler"),this.pending=[],this.running=[],this.logger("Constructed, concurrency=%s",e)}schedule(){if(!this.pending.length||this.running.length>=this.concurrency){this.logger("Schedule attempt ignored, pending=%s running=%s concurrency=%s",this.pending.length,this.running.length,this.concurrency);return}let e=$(this.running,this.pending.shift());this.logger("Attempting id=%s",e.id),e.done(()=>{this.logger("Completing id=",e.id),Ee(this.running,e),this.schedule()})}next(){let{promise:e,id:t}=$(this.pending,is());return this.logger("Scheduling id=%s",t),this.schedule(),e}}}}),qi={};q(qi,{applyPatchTask:()=>fc});function fc(e,t){return it(["apply",...t,...e])}var pc=d({"src/lib/tasks/apply-patch.ts"(){"use strict";W()}});function mc(e,t){return{branch:e,hash:t,success:!0}}function dc(e){return{branch:e,hash:null,success:!1}}var Ui,gc=d({"src/lib/responses/BranchDeleteSummary.ts"(){"use strict";Ui=class{constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function zi(e,t){return t===1&&Mr.test(e)}var os,Mr,as,Pe,_c=d({"src/lib/parsers/parse-branch-delete.ts"(){"use strict";gc(),O(),os=/(\S+)\s+\(\S+\s([^)]+)\)/,Mr=/^error[^']+'([^']+)'/m,as=[new S(os,(e,[t,r])=>{let n=mc(t,r);e.all.push(n),e.branches[t]=n}),new S(Mr,(e,[t])=>{let r=dc(t);e.errors.push(r),e.all.push(r),e.branches[t]=r})],Pe=(e,t)=>lt(new Ui,as,[e,t])}}),Yi,bc=d({"src/lib/responses/BranchSummary.ts"(){"use strict";Yi=class{constructor(){this.all=[],this.branches={},this.current="",this.detached=!1}push(e,t,r,n,s){e==="*"&&(this.detached=t,this.current=r),this.all.push(r),this.branches[r]={current:e==="*",linkedWorkTree:e==="+",name:r,commit:n,label:s}}}}});function us(e){return e?e.charAt(0):""}function Ji(e){return lt(new Yi,Ki,e)}var Ki,yc=d({"src/lib/parsers/parse-branch.ts"(){"use strict";bc(),O(),Ki=[new S(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(e,[t,r,n,s])=>{e.push(us(t),!0,r,n,s)}),new S(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,(e,[t,r,n,s])=>{e.push(us(t),!1,r,n,s)})]}}),Qi={};q(Qi,{branchLocalTask:()=>Cc,branchTask:()=>vc,containsDeleteBranchCommand:()=>Zi,deleteBranchTask:()=>kc,deleteBranchesTask:()=>wc});function Zi(e){let t=["-d","-D","--delete"];return e.some(r=>t.includes(r))}function vc(e){let t=Zi(e),r=["branch",...e];return r.length===1&&r.push("-a"),r.includes("-v")||r.splice(1,0,"-v"),{format:"utf-8",commands:r,parser(n,s){return t?Pe(n,s).all[0]:Ji(n)}}}function Cc(){return{format:"utf-8",commands:["branch","-v"],parser:Ji}}function wc(e,t=!1){return{format:"utf-8",commands:["branch","-v",t?"-D":"-d",...e],parser(r,n){return Pe(r,n)},onError({exitCode:r,stdOut:n},s,i,o){if(!zi(String(s),r))return o(s);i(n)}}}function kc(e,t=!1){let r={format:"utf-8",commands:["branch","-v",t?"-D":"-d",e],parser(n,s){return Pe(n,s).branches[e]},onError({exitCode:n,stdErr:s,stdOut:i},o,a,l){if(!zi(String(o),n))return l(o);throw new te(r.parser(Zt(i),Zt(s)),String(o))}};return r}var Oc=d({"src/lib/tasks/branch.ts"(){"use strict";zt(),_c(),yc(),O()}}),Xi,Tc=d({"src/lib/responses/CheckIgnore.ts"(){"use strict";Xi=e=>e.split(/\n/g).map(t=>t.trim()).filter(t=>!!t)}}),to={};q(to,{checkIgnoreTask:()=>xc});function xc(e){return{commands:["check-ignore",...e],format:"utf-8",parser:Xi}}var Sc=d({"src/lib/tasks/check-ignore.ts"(){"use strict";Tc()}}),eo={};q(eo,{cloneMirrorTask:()=>Ec,cloneTask:()=>ro});function Ac(e){return/^--upload-pack(=|$)/.test(e)}function ro(e,t,r){let n=["clone",...r];return et(e)&&n.push(e),et(t)&&n.push(t),n.find(Ac)?ct("git.fetch: potential exploit argument blocked."):it(n)}function Ec(e,t,r){return $(r,"--mirror"),ro(e,t,r)}var $c=d({"src/lib/tasks/clone.ts"(){"use strict";W(),O()}});function Rc(e,t){return lt({raw:e,remote:null,branches:[],tags:[],updated:[],deleted:[]},no,[e,t])}var no,Fc=d({"src/lib/parsers/parse-fetch.ts"(){"use strict";O(),no=[new S(/From (.+)$/,(e,[t])=>{e.remote=t}),new S(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(e,[t,r])=>{e.branches.push({name:t,tracking:r})}),new S(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(e,[t,r])=>{e.tags.push({name:t,tracking:r})}),new S(/- \[deleted]\s+\S+\s*-> (.+)$/,(e,[t])=>{e.deleted.push({tracking:t})}),new S(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(e,[t,r,n,s])=>{e.updated.push({name:n,tracking:s,to:r,from:t})})]}}),so={};q(so,{fetchTask:()=>Dc});function Mc(e){return/^--upload-pack(=|$)/.test(e)}function Dc(e,t,r){let n=["fetch",...r];return e&&t&&n.push(e,t),n.find(Mc)?ct("git.fetch: potential exploit argument blocked."):{commands:n,format:"utf-8",parser:Rc}}var Pc=d({"src/lib/tasks/fetch.ts"(){"use strict";Fc(),W()}});function Ic(e){return lt({moves:[]},io,e)}var io,Lc=d({"src/lib/parsers/parse-move.ts"(){"use strict";O(),io=[new S(/^Renaming (.+) to (.+)$/,(e,[t,r])=>{e.moves.push({from:t,to:r})})]}}),oo={};q(oo,{moveTask:()=>jc});function jc(e,t){return{commands:["mv","-v",...yt(e),t],format:"utf-8",parser:Ic}}var Nc=d({"src/lib/tasks/move.ts"(){"use strict";Lc(),O()}}),ao={};q(ao,{pullTask:()=>Hc});function Hc(e,t,r){let n=["pull",...r];return e&&t&&n.splice(1,0,e,t),{commands:n,format:"utf-8",parser(s,i){return tn(s,i)},onError(s,i,o,a){let l=zu(Zt(s.stdOut),Zt(s.stdErr));if(l)return a(new te(l));a(i)}}}var Bc=d({"src/lib/tasks/pull.ts"(){"use strict";zt(),Ri(),O()}});function Gc(e){let t={};return uo(e,([r])=>t[r]={name:r}),Object.values(t)}function Vc(e){let t={};return uo(e,([r,n,s])=>{t.hasOwnProperty(r)||(t[r]={name:r,refs:{fetch:"",push:""}}),s&&n&&(t[r].refs[s.replace(/[^a-z]/g,"")]=n)}),Object.values(t)}function uo(e,t){Ir(e,r=>t(r.split(/\s+/)))}var Wc=d({"src/lib/responses/GetRemoteSummary.ts"(){"use strict";O()}}),co={};q(co,{addRemoteTask:()=>qc,getRemotesTask:()=>Uc,listRemotesTask:()=>zc,remoteTask:()=>Yc,removeRemoteTask:()=>Jc});function qc(e,t,r){return it(["remote","add",...r,e,t])}function Uc(e){let t=["remote"];return e&&t.push("-v"),{commands:t,format:"utf-8",parser:e?Vc:Gc}}function zc(e){let t=[...e];return t[0]!=="ls-remote"&&t.unshift("ls-remote"),it(t)}function Yc(e){let t=[...e];return t[0]!=="remote"&&t.unshift("remote"),it(t)}function Jc(e){return it(["remote","remove",e])}var Kc=d({"src/lib/tasks/remote.ts"(){"use strict";Wc(),W()}}),lo={};q(lo,{stashListTask:()=>Qc});function Qc(e={},t){let r=Ci(e),n=["stash","list",...r.commands,...t],s=_i(r.splitter,r.fields,Yr(n));return De(n)||{commands:n,format:"utf-8",parser:s}}var Zc=d({"src/lib/tasks/stash-list.ts"(){"use strict";se(),yi(),Xr(),wi()}}),ho={};q(ho,{addSubModuleTask:()=>Xc,initSubModuleTask:()=>tl,subModuleTask:()=>Ie,updateSubModuleTask:()=>el});function Xc(e,t){return Ie(["add",e,t])}function tl(e){return Ie(["init",...e])}function Ie(e){let t=[...e];return t[0]!=="submodule"&&t.unshift("submodule"),it(t)}function el(e){return Ie(["update",...e])}var rl=d({"src/lib/tasks/sub-module.ts"(){"use strict";W()}});function nl(e,t){let r=isNaN(e),n=isNaN(t);return r!==n?r?1:-1:r?fo(e,t):0}function fo(e,t){return e===t?0:e>t?1:-1}function sl(e){return e.trim()}function _e(e){return typeof e=="string"&&parseInt(e.replace(/^\D+/g,""),10)||0}var cs,po,il=d({"src/lib/responses/TagList.ts"(){"use strict";cs=class{constructor(e,t){this.all=e,this.latest=t}},po=function(e,t=!1){let r=e.split(`
35
- `).map(sl).filter(Boolean);t||r.sort(function(s,i){let o=s.split("."),a=i.split(".");if(o.length===1||a.length===1)return nl(_e(o[0]),_e(a[0]));for(let l=0,h=Math.max(o.length,a.length);l<h;l++){let u=fo(_e(o[l]),_e(a[l]));if(u)return u}return 0});let n=t?r[0]:[...r].reverse().find(s=>s.indexOf(".")>=0);return new cs(r,n)}}}),mo={};q(mo,{addAnnotatedTagTask:()=>ul,addTagTask:()=>al,tagListTask:()=>ol});function ol(e=[]){let t=e.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...e],parser(r){return po(r,t)}}}function al(e){return{format:"utf-8",commands:["tag",e],parser(){return{name:e}}}}function ul(e,t){return{format:"utf-8",commands:["tag","-a","-m",t,e],parser(){return{name:e}}}}var cl=d({"src/lib/tasks/tag.ts"(){"use strict";il()}}),ll=Ta({"src/git.js"(e,t){"use strict";var{GitExecutor:r}=(fu(),G(ai)),{SimpleGitApi:n}=(lc(),G(Bi)),{Scheduler:s}=(hc(),G(Gi)),{configurationErrorTask:i}=(W(),G(xr)),{asArray:o,filterArray:a,filterPrimitives:l,filterString:h,filterStringOrStringArray:u,filterType:c,getTrailingOptions:f,trailingFunctionArgument:p,trailingOptionsArgument:E}=(O(),G(Rs)),{applyPatchTask:M}=(pc(),G(qi)),{branchTask:I,branchLocalTask:j,deleteBranchesTask:K,deleteBranchTask:U}=(Oc(),G(Qi)),{checkIgnoreTask:J}=(Sc(),G(to)),{checkIsRepoTask:mt}=(Ps(),G(Fs)),{cloneTask:rt,cloneMirrorTask:ht}=($c(),G(eo)),{cleanWithOptionsTask:F,isCleanOptionsArray:A}=(Us(),G(Ws)),{diffSummaryTask:Nt}=(Xr(),G(vi)),{fetchTask:oe}=(Pc(),G(so)),{moveTask:k}=(Nc(),G(oo)),{pullTask:b}=(Bc(),G(ao)),{pushTagsTask:g}=(Pi(),G(Di)),{addRemoteTask:v,getRemotesTask:_,listRemotesTask:T,remoteTask:x,removeRemoteTask:D}=(Kc(),G(co)),{getResetMode:N,resetTask:z}=(si(),G(ei)),{stashListTask:Q}=(Zc(),G(lo)),{addSubModuleTask:ot,initSubModuleTask:Et,subModuleTask:wt,updateSubModuleTask:Ft}=(rl(),G(ho)),{addAnnotatedTagTask:kt,addTagTask:X,tagListTask:bt}=(cl(),G(mo)),{straightThroughBufferTask:Mt,straightThroughStringTask:nt}=(W(),G(xr));function C(m,y){this._plugins=y,this._executor=new r(m.baseDir,new s(m.maxConcurrentProcesses),y),this._trimmed=m.trimmed}(C.prototype=Object.create(n.prototype)).constructor=C,C.prototype.customBinary=function(m){return this._plugins.reconfigure("binary",m),this},C.prototype.env=function(m,y){return arguments.length===1&&typeof m=="object"?this._executor.env=m:(this._executor.env=this._executor.env||{})[m]=y,this},C.prototype.stashList=function(m){return this._runTask(Q(E(arguments)||{},a(m)&&m||[]),p(arguments))};function on(m,y,P,st){return typeof P!="string"?i(`git.${m}() requires a string 'repoPath'`):y(P,c(st,h),f(arguments))}C.prototype.clone=function(){return this._runTask(on("clone",rt,...arguments),p(arguments))},C.prototype.mirror=function(){return this._runTask(on("mirror",ht,...arguments),p(arguments))},C.prototype.mv=function(m,y){return this._runTask(k(m,y),p(arguments))},C.prototype.checkoutLatestTag=function(m){var y=this;return this.pull(function(){y.tags(function(P,st){y.checkout(st.latest,m)})})},C.prototype.pull=function(m,y,P,st){return this._runTask(b(c(m,h),c(y,h),f(arguments)),p(arguments))},C.prototype.fetch=function(m,y){return this._runTask(oe(c(m,h),c(y,h),f(arguments)),p(arguments))},C.prototype.silent=function(m){return console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this will be an error in version 3"),this},C.prototype.tags=function(m,y){return this._runTask(bt(f(arguments)),p(arguments))},C.prototype.rebase=function(){return this._runTask(nt(["rebase",...f(arguments)]),p(arguments))},C.prototype.reset=function(m){return this._runTask(z(N(m),f(arguments)),p(arguments))},C.prototype.revert=function(m){let y=p(arguments);return typeof m!="string"?this._runTask(i("Commit must be a string"),y):this._runTask(nt(["revert",...f(arguments,0,!0),m]),y)},C.prototype.addTag=function(m){let y=typeof m=="string"?X(m):i("Git.addTag requires a tag name");return this._runTask(y,p(arguments))},C.prototype.addAnnotatedTag=function(m,y){return this._runTask(kt(m,y),p(arguments))},C.prototype.deleteLocalBranch=function(m,y,P){return this._runTask(U(m,typeof y=="boolean"?y:!1),p(arguments))},C.prototype.deleteLocalBranches=function(m,y,P){return this._runTask(K(m,typeof y=="boolean"?y:!1),p(arguments))},C.prototype.branch=function(m,y){return this._runTask(I(f(arguments)),p(arguments))},C.prototype.branchLocal=function(m){return this._runTask(j(),p(arguments))},C.prototype.raw=function(m){let y=!Array.isArray(m),P=[].slice.call(y?arguments:m,0);for(let gt=0;gt<P.length&&y;gt++)if(!l(P[gt])){P.splice(gt,P.length-gt);break}P.push(...f(arguments,0,!0));var st=p(arguments);return P.length?this._runTask(nt(P,this._trimmed),st):this._runTask(i("Raw: must supply one or more command to execute"),st)},C.prototype.submoduleAdd=function(m,y,P){return this._runTask(ot(m,y),p(arguments))},C.prototype.submoduleUpdate=function(m,y){return this._runTask(Ft(f(arguments,!0)),p(arguments))},C.prototype.submoduleInit=function(m,y){return this._runTask(Et(f(arguments,!0)),p(arguments))},C.prototype.subModule=function(m,y){return this._runTask(wt(f(arguments)),p(arguments))},C.prototype.listRemote=function(){return this._runTask(T(f(arguments)),p(arguments))},C.prototype.addRemote=function(m,y,P){return this._runTask(v(m,y,f(arguments)),p(arguments))},C.prototype.removeRemote=function(m,y){return this._runTask(D(m),p(arguments))},C.prototype.getRemotes=function(m,y){return this._runTask(_(m===!0),p(arguments))},C.prototype.remote=function(m,y){return this._runTask(x(f(arguments)),p(arguments))},C.prototype.tag=function(m,y){let P=f(arguments);return P[0]!=="tag"&&P.unshift("tag"),this._runTask(nt(P),p(arguments))},C.prototype.updateServerInfo=function(m){return this._runTask(nt(["update-server-info"]),p(arguments))},C.prototype.pushTags=function(m,y){let P=g({remote:c(m,h)},f(arguments));return this._runTask(P,p(arguments))},C.prototype.rm=function(m){return this._runTask(nt(["rm","-f",...o(m)]),p(arguments))},C.prototype.rmKeepLocal=function(m){return this._runTask(nt(["rm","--cached",...o(m)]),p(arguments))},C.prototype.catFile=function(m,y){return this._catFile("utf-8",arguments)},C.prototype.binaryCatFile=function(){return this._catFile("buffer",arguments)},C.prototype._catFile=function(m,y){var P=p(y),st=["cat-file"],gt=y[0];if(typeof gt=="string")return this._runTask(i("Git.catFile: options must be supplied as an array of strings"),P);Array.isArray(gt)&&st.push.apply(st,gt);let je=m==="buffer"?Mt(st):nt(st);return this._runTask(je,P)},C.prototype.diff=function(m,y){let P=h(m)?i("git.diff: supplying options as a single string is no longer supported, switch to an array of strings"):nt(["diff",...f(arguments)]);return this._runTask(P,p(arguments))},C.prototype.diffSummary=function(){return this._runTask(Nt(f(arguments,1)),p(arguments))},C.prototype.applyPatch=function(m){let y=u(m)?M(o(m),f([].slice.call(arguments,1))):i("git.applyPatch requires one or more string patches as the first argument");return this._runTask(y,p(arguments))},C.prototype.revparse=function(){let m=["rev-parse",...f(arguments,!0)];return this._runTask(nt(m,!0),p(arguments))},C.prototype.clean=function(m,y,P){let st=A(m),gt=st&&m.join("")||c(m,h)||"",je=f([].slice.call(arguments,st?1:0));return this._runTask(F(gt,je),p(arguments))},C.prototype.exec=function(m){let y={commands:[],format:"utf-8",parser(){typeof m=="function"&&m()}};return this._runTask(y)},C.prototype.clearQueue=function(){return this},C.prototype.checkIgnore=function(m,y){return this._runTask(J(o(c(m,u,[]))),p(arguments))},C.prototype.checkIsRepo=function(m,y){return this._runTask(mt(c(m,h)),p(arguments))},t.exports=C}});Xt();Rt();var hl=class extends At{constructor(e,t){super(void 0,t),this.config=e}};Rt();Rt();var St=class extends At{constructor(e,t,r){super(e,r),this.task=e,this.plugin=t,Object.setPrototypeOf(this,new.target.prototype)}};zt();ds();Ps();Us();Js();Qs();ti();si();function fl(e){return e?[{type:"spawn.before",action(n,s){e.aborted&&s.kill(new St(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(n,s){function i(){s.kill(new St(void 0,"abort","Abort signal received"))}e.addEventListener("abort",i),s.spawned.on("close",()=>e.removeEventListener("abort",i))}}]:void 0}function pl(e){return typeof e=="string"&&e.trim().toLowerCase()==="-c"}function ml(e,t){if(pl(e)&&/^\s*protocol(.[a-z]+)?.allow/.test(t))throw new St(void 0,"unsafe","Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol")}function dl(e,t){if(/^\s*--(upload|receive)-pack/.test(e))throw new St(void 0,"unsafe","Use of --upload-pack or --receive-pack is not permitted without enabling allowUnsafePack");if(t==="clone"&&/^\s*-u\b/.test(e))throw new St(void 0,"unsafe","Use of clone with option -u is not permitted without enabling allowUnsafePack");if(t==="push"&&/^\s*--exec\b/.test(e))throw new St(void 0,"unsafe","Use of push with option --exec is not permitted without enabling allowUnsafePack")}function gl({allowUnsafeProtocolOverride:e=!1,allowUnsafePack:t=!1}={}){return{type:"spawn.args",action(r,n){return r.forEach((s,i)=>{let o=i<r.length?r[i+1]:"";e||ml(s,o),t||dl(s,n.method)}),r}}}O();function _l(e){let t=Qt(e,"-c");return{type:"spawn.args",action(r){return[...t,...r]}}}O();var ls=(0,qt.deferred)().promise;function bl({onClose:e=!0,onExit:t=50}={}){function r(){let s=-1,i={close:(0,qt.deferred)(),closeTimeout:(0,qt.deferred)(),exit:(0,qt.deferred)(),exitTimeout:(0,qt.deferred)()},o=Promise.race([e===!1?ls:i.closeTimeout.promise,t===!1?ls:i.exitTimeout.promise]);return n(e,i.close,i.closeTimeout),n(t,i.exit,i.exitTimeout),{close(a){s=a,i.close.done()},exit(a){s=a,i.exit.done()},get exitCode(){return s},result:o}}function n(s,i,o){s!==!1&&(s===!0?i.promise:i.promise.then(()=>vr(s))).then(o.done)}return{type:"spawn.after",async action(s,{spawned:i,close:o}){let a=r(),l=!0,h=()=>void(l=!1);i.stdout?.on("data",h),i.stderr?.on("data",h),i.on("error",h),i.on("close",u=>a.close(u)),i.on("exit",u=>a.exit(u));try{await a.result,l&&await vr(50),o(a.exitCode)}catch(u){o(a.exitCode,u)}}}}O();var yl="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",hs="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function vl(e){return!e||!/^([a-z]:)?([a-z0-9/.\\_-]+)$/i.test(e)}function fs(e,t){if(e.length<1||e.length>2)throw new St(void 0,"binary",yl);if(e.some(vl))if(t)console.warn(hs);else throw new St(void 0,"binary",hs);let[n,s]=e;return{binary:n,prefix:s}}function Cl(e,t=["git"],r=!1){let n=fs(yt(t),r);e.on("binary",s=>{n=fs(yt(s),r)}),e.append("spawn.binary",()=>n.binary),e.append("spawn.args",s=>n.prefix?[n.prefix,...s]:s)}Rt();function wl(e){return!!(e.exitCode&&e.stdErr.length)}function kl(e){return Buffer.concat([...e.stdOut,...e.stdErr])}function Ol(e=!1,t=wl,r=kl){return(n,s)=>!e&&n||!t(s)?n:r(s)}function ps(e){return{type:"task.error",action(t,r){let n=e(t.error,{stdErr:r.stdErr,stdOut:r.stdOut,exitCode:r.exitCode});return Buffer.isBuffer(n)?{error:new At(void 0,n.toString("utf-8"))}:{error:n}}}}O();var xl=class{constructor(){this.plugins=new Set,this.events=new Tl}on(e,t){this.events.on(e,t)}reconfigure(e,t){this.events.emit(e,t)}append(e,t){let r=$(this.plugins,{type:e,action:t});return()=>this.plugins.delete(r)}add(e){let t=[];return yt(e).forEach(r=>r&&this.plugins.add($(t,r))),()=>{t.forEach(r=>this.plugins.delete(r))}}exec(e,t,r){let n=t,s=Object.freeze(Object.create(r));for(let i of this.plugins)i.type===e&&(n=i.action(n,s));return n}};O();function Sl(e){let t="--progress",r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(i,o){return r.includes(o.method)?Cs(i,t):i}},{type:"spawn.after",action(i,o){o.commands.includes(t)&&o.spawned.stderr?.on("data",a=>{let l=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(a.toString("utf8"));l&&e({method:o.method,stage:Al(l[1]),progress:L(l[2]),processed:L(l[3]),total:L(l[4])})})}}]}function Al(e){return String(e.toLowerCase().split(" ",1))||"unknown"}O();function El(e){let t=Os(e,["uid","gid"]);return{type:"spawn.options",action(r){return{...t,...r}}}}function $l({block:e,stdErr:t=!0,stdOut:r=!0}){if(e>0)return{type:"spawn.after",action(n,s){let i;function o(){i&&clearTimeout(i),i=setTimeout(l,e)}function a(){s.spawned.stdout?.off("data",o),s.spawned.stderr?.off("data",o),s.spawned.off("exit",a),s.spawned.off("close",a),i&&clearTimeout(i)}function l(){a(),s.kill(new St(void 0,"timeout","block timeout reached"))}r&&s.spawned.stdout?.on("data",o),t&&s.spawned.stderr?.on("data",o),s.spawned.on("exit",a),s.spawned.on("close",a),o()}}}Xt();function Rl(){return{type:"spawn.args",action(e){let t=[],r;function n(s){(r=r||[]).push(...s)}for(let s=0;s<e.length;s++){let i=e[s];if(we(i)){n(Ln(i));continue}if(i==="--"){n(e.slice(s+1).flatMap(o=>we(o)&&Ln(o)||o));break}t.push(i)}return r?[...t,"--",...r.map(String)]:t}}}O();var Fl=ll();function Ml(e,t){let r=new xl,n=Es(e&&(typeof e=="string"?{baseDir:e}:e)||{},t);if(!Lr(n.baseDir))throw new hl(n,"Cannot use simple-git on a directory that does not exist");return Array.isArray(n.config)&&r.add(_l(n.config)),r.add(gl(n.unsafe)),r.add(Rl()),r.add(bl(n.completion)),n.abort&&r.add(fl(n.abort)),n.progress&&r.add(Sl(n.progress)),n.timeout&&r.add($l(n.timeout)),n.spawnOptions&&r.add(El(n.spawnOptions)),r.add(ps(Ol(!0))),n.errors&&r.add(ps(n.errors)),Cl(r,n.binary,n.unsafe?.allowUnsafeCustomBinary),new Fl(n,r)}zt();var go=Ml;var bo="@lntvow/dev",yo="4.4.4";w();var nn=Tt(nr(),1);import ie from"fs";import Le from"path";import{fileURLToPath as Dl}from"url";var Pl=Dl(import.meta.url),Il=Le.dirname(Pl);function vo(e,t){ie.existsSync(t)||ie.mkdirSync(t),ie.readdirSync(e,{withFileTypes:!0}).forEach(n=>{let s=Le.resolve(e,n.name),i=Le.resolve(t,n.name);if(n.isDirectory())vo(s,i);else{if(ie.existsSync(i))return;ie.copyFileSync(s,i)}})}function Co(){console.log(nn.default.blue("Start copying template files")),vo(Le.resolve(Il,"./configs"),process.cwd()),console.log(nn.default.green("Template files copied successfully"))}sn.default.extend(wo.default);console.log(Ct.default.blue(`Cwd is ${process.cwd()}`));Jt.name(bo).version(yo,"-v, --version","output the version number");Jt.command("init").option("-t, --temp","copy template files",!0).option("--no-temp","not copy template files").option("-g, --git","init simple-git-hooks",!0).option("--no-git","not init simple-git-hooks").option("-s, --scripts","init scripts",!0).option("--no-scripts","not init scripts").description("init project").action(e=>{console.log(Ct.default.green("Init project by @lntvow/dev"));let{temp:t,git:r,scripts:n}=e;if(t&&Co(),r){console.log(Ct.default.blue("Start init simple-git-hooks"));let s=Ll("npx simple-git-hooks");console.log(s.toString())}if(n){console.log(Ct.default.blue("Start init scripts"));try{let s=Hl(process.cwd(),"package.json"),i=JSON.parse(jl(s,"utf-8"));i={...i,scripts:{postinstall:"simple-git-hooks",rimraf:"rimraf ./node_modules/",commit:"git add . && git-cz && git push",release:"git add . && bumpp package.json --all --no-tag --no-print-commits","lint:eslint":'eslint "src/**/*.{js,jsx,ts,tsx,vue}" --fix',"lint:tsc":"tsc --noEmit",lint:"run-p lint:eslint lint:tsc",ncu:"ncu -u && pnpm install",...i.scripts}},Nl(s,JSON.stringify(i,null,2)),console.log(Ct.default.green("Scripts added successfully"))}catch{console.log(Ct.default.yellow("No package.json file found ignoring scripts"))}}console.log(Ct.default.yellow(`
35
+ `).map(sl).filter(Boolean);t||r.sort(function(s,i){let o=s.split("."),a=i.split(".");if(o.length===1||a.length===1)return nl(_e(o[0]),_e(a[0]));for(let l=0,h=Math.max(o.length,a.length);l<h;l++){let u=fo(_e(o[l]),_e(a[l]));if(u)return u}return 0});let n=t?r[0]:[...r].reverse().find(s=>s.indexOf(".")>=0);return new cs(r,n)}}}),mo={};q(mo,{addAnnotatedTagTask:()=>ul,addTagTask:()=>al,tagListTask:()=>ol});function ol(e=[]){let t=e.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...e],parser(r){return po(r,t)}}}function al(e){return{format:"utf-8",commands:["tag",e],parser(){return{name:e}}}}function ul(e,t){return{format:"utf-8",commands:["tag","-a","-m",t,e],parser(){return{name:e}}}}var cl=d({"src/lib/tasks/tag.ts"(){"use strict";il()}}),ll=Ta({"src/git.js"(e,t){"use strict";var{GitExecutor:r}=(fu(),G(ai)),{SimpleGitApi:n}=(lc(),G(Bi)),{Scheduler:s}=(hc(),G(Gi)),{configurationErrorTask:i}=(W(),G(xr)),{asArray:o,filterArray:a,filterPrimitives:l,filterString:h,filterStringOrStringArray:u,filterType:c,getTrailingOptions:f,trailingFunctionArgument:p,trailingOptionsArgument:E}=(O(),G(Rs)),{applyPatchTask:M}=(pc(),G(qi)),{branchTask:I,branchLocalTask:j,deleteBranchesTask:K,deleteBranchTask:U}=(Oc(),G(Qi)),{checkIgnoreTask:J}=(Sc(),G(to)),{checkIsRepoTask:mt}=(Ps(),G(Fs)),{cloneTask:rt,cloneMirrorTask:ht}=($c(),G(eo)),{cleanWithOptionsTask:F,isCleanOptionsArray:A}=(Us(),G(Ws)),{diffSummaryTask:Nt}=(Xr(),G(vi)),{fetchTask:oe}=(Pc(),G(so)),{moveTask:k}=(Nc(),G(oo)),{pullTask:b}=(Bc(),G(ao)),{pushTagsTask:g}=(Pi(),G(Di)),{addRemoteTask:v,getRemotesTask:_,listRemotesTask:T,remoteTask:x,removeRemoteTask:D}=(Kc(),G(co)),{getResetMode:N,resetTask:z}=(si(),G(ei)),{stashListTask:Q}=(Zc(),G(lo)),{addSubModuleTask:ot,initSubModuleTask:Et,subModuleTask:wt,updateSubModuleTask:Ft}=(rl(),G(ho)),{addAnnotatedTagTask:kt,addTagTask:X,tagListTask:bt}=(cl(),G(mo)),{straightThroughBufferTask:Mt,straightThroughStringTask:nt}=(W(),G(xr));function C(m,y){this._plugins=y,this._executor=new r(m.baseDir,new s(m.maxConcurrentProcesses),y),this._trimmed=m.trimmed}(C.prototype=Object.create(n.prototype)).constructor=C,C.prototype.customBinary=function(m){return this._plugins.reconfigure("binary",m),this},C.prototype.env=function(m,y){return arguments.length===1&&typeof m=="object"?this._executor.env=m:(this._executor.env=this._executor.env||{})[m]=y,this},C.prototype.stashList=function(m){return this._runTask(Q(E(arguments)||{},a(m)&&m||[]),p(arguments))};function on(m,y,P,st){return typeof P!="string"?i(`git.${m}() requires a string 'repoPath'`):y(P,c(st,h),f(arguments))}C.prototype.clone=function(){return this._runTask(on("clone",rt,...arguments),p(arguments))},C.prototype.mirror=function(){return this._runTask(on("mirror",ht,...arguments),p(arguments))},C.prototype.mv=function(m,y){return this._runTask(k(m,y),p(arguments))},C.prototype.checkoutLatestTag=function(m){var y=this;return this.pull(function(){y.tags(function(P,st){y.checkout(st.latest,m)})})},C.prototype.pull=function(m,y,P,st){return this._runTask(b(c(m,h),c(y,h),f(arguments)),p(arguments))},C.prototype.fetch=function(m,y){return this._runTask(oe(c(m,h),c(y,h),f(arguments)),p(arguments))},C.prototype.silent=function(m){return console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this will be an error in version 3"),this},C.prototype.tags=function(m,y){return this._runTask(bt(f(arguments)),p(arguments))},C.prototype.rebase=function(){return this._runTask(nt(["rebase",...f(arguments)]),p(arguments))},C.prototype.reset=function(m){return this._runTask(z(N(m),f(arguments)),p(arguments))},C.prototype.revert=function(m){let y=p(arguments);return typeof m!="string"?this._runTask(i("Commit must be a string"),y):this._runTask(nt(["revert",...f(arguments,0,!0),m]),y)},C.prototype.addTag=function(m){let y=typeof m=="string"?X(m):i("Git.addTag requires a tag name");return this._runTask(y,p(arguments))},C.prototype.addAnnotatedTag=function(m,y){return this._runTask(kt(m,y),p(arguments))},C.prototype.deleteLocalBranch=function(m,y,P){return this._runTask(U(m,typeof y=="boolean"?y:!1),p(arguments))},C.prototype.deleteLocalBranches=function(m,y,P){return this._runTask(K(m,typeof y=="boolean"?y:!1),p(arguments))},C.prototype.branch=function(m,y){return this._runTask(I(f(arguments)),p(arguments))},C.prototype.branchLocal=function(m){return this._runTask(j(),p(arguments))},C.prototype.raw=function(m){let y=!Array.isArray(m),P=[].slice.call(y?arguments:m,0);for(let gt=0;gt<P.length&&y;gt++)if(!l(P[gt])){P.splice(gt,P.length-gt);break}P.push(...f(arguments,0,!0));var st=p(arguments);return P.length?this._runTask(nt(P,this._trimmed),st):this._runTask(i("Raw: must supply one or more command to execute"),st)},C.prototype.submoduleAdd=function(m,y,P){return this._runTask(ot(m,y),p(arguments))},C.prototype.submoduleUpdate=function(m,y){return this._runTask(Ft(f(arguments,!0)),p(arguments))},C.prototype.submoduleInit=function(m,y){return this._runTask(Et(f(arguments,!0)),p(arguments))},C.prototype.subModule=function(m,y){return this._runTask(wt(f(arguments)),p(arguments))},C.prototype.listRemote=function(){return this._runTask(T(f(arguments)),p(arguments))},C.prototype.addRemote=function(m,y,P){return this._runTask(v(m,y,f(arguments)),p(arguments))},C.prototype.removeRemote=function(m,y){return this._runTask(D(m),p(arguments))},C.prototype.getRemotes=function(m,y){return this._runTask(_(m===!0),p(arguments))},C.prototype.remote=function(m,y){return this._runTask(x(f(arguments)),p(arguments))},C.prototype.tag=function(m,y){let P=f(arguments);return P[0]!=="tag"&&P.unshift("tag"),this._runTask(nt(P),p(arguments))},C.prototype.updateServerInfo=function(m){return this._runTask(nt(["update-server-info"]),p(arguments))},C.prototype.pushTags=function(m,y){let P=g({remote:c(m,h)},f(arguments));return this._runTask(P,p(arguments))},C.prototype.rm=function(m){return this._runTask(nt(["rm","-f",...o(m)]),p(arguments))},C.prototype.rmKeepLocal=function(m){return this._runTask(nt(["rm","--cached",...o(m)]),p(arguments))},C.prototype.catFile=function(m,y){return this._catFile("utf-8",arguments)},C.prototype.binaryCatFile=function(){return this._catFile("buffer",arguments)},C.prototype._catFile=function(m,y){var P=p(y),st=["cat-file"],gt=y[0];if(typeof gt=="string")return this._runTask(i("Git.catFile: options must be supplied as an array of strings"),P);Array.isArray(gt)&&st.push.apply(st,gt);let je=m==="buffer"?Mt(st):nt(st);return this._runTask(je,P)},C.prototype.diff=function(m,y){let P=h(m)?i("git.diff: supplying options as a single string is no longer supported, switch to an array of strings"):nt(["diff",...f(arguments)]);return this._runTask(P,p(arguments))},C.prototype.diffSummary=function(){return this._runTask(Nt(f(arguments,1)),p(arguments))},C.prototype.applyPatch=function(m){let y=u(m)?M(o(m),f([].slice.call(arguments,1))):i("git.applyPatch requires one or more string patches as the first argument");return this._runTask(y,p(arguments))},C.prototype.revparse=function(){let m=["rev-parse",...f(arguments,!0)];return this._runTask(nt(m,!0),p(arguments))},C.prototype.clean=function(m,y,P){let st=A(m),gt=st&&m.join("")||c(m,h)||"",je=f([].slice.call(arguments,st?1:0));return this._runTask(F(gt,je),p(arguments))},C.prototype.exec=function(m){let y={commands:[],format:"utf-8",parser(){typeof m=="function"&&m()}};return this._runTask(y)},C.prototype.clearQueue=function(){return this},C.prototype.checkIgnore=function(m,y){return this._runTask(J(o(c(m,u,[]))),p(arguments))},C.prototype.checkIsRepo=function(m,y){return this._runTask(mt(c(m,h)),p(arguments))},t.exports=C}});Xt();Rt();var hl=class extends At{constructor(e,t){super(void 0,t),this.config=e}};Rt();Rt();var St=class extends At{constructor(e,t,r){super(e,r),this.task=e,this.plugin=t,Object.setPrototypeOf(this,new.target.prototype)}};zt();ds();Ps();Us();Js();Qs();ti();si();function fl(e){return e?[{type:"spawn.before",action(n,s){e.aborted&&s.kill(new St(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(n,s){function i(){s.kill(new St(void 0,"abort","Abort signal received"))}e.addEventListener("abort",i),s.spawned.on("close",()=>e.removeEventListener("abort",i))}}]:void 0}function pl(e){return typeof e=="string"&&e.trim().toLowerCase()==="-c"}function ml(e,t){if(pl(e)&&/^\s*protocol(.[a-z]+)?.allow/.test(t))throw new St(void 0,"unsafe","Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol")}function dl(e,t){if(/^\s*--(upload|receive)-pack/.test(e))throw new St(void 0,"unsafe","Use of --upload-pack or --receive-pack is not permitted without enabling allowUnsafePack");if(t==="clone"&&/^\s*-u\b/.test(e))throw new St(void 0,"unsafe","Use of clone with option -u is not permitted without enabling allowUnsafePack");if(t==="push"&&/^\s*--exec\b/.test(e))throw new St(void 0,"unsafe","Use of push with option --exec is not permitted without enabling allowUnsafePack")}function gl({allowUnsafeProtocolOverride:e=!1,allowUnsafePack:t=!1}={}){return{type:"spawn.args",action(r,n){return r.forEach((s,i)=>{let o=i<r.length?r[i+1]:"";e||ml(s,o),t||dl(s,n.method)}),r}}}O();function _l(e){let t=Qt(e,"-c");return{type:"spawn.args",action(r){return[...t,...r]}}}O();var ls=(0,qt.deferred)().promise;function bl({onClose:e=!0,onExit:t=50}={}){function r(){let s=-1,i={close:(0,qt.deferred)(),closeTimeout:(0,qt.deferred)(),exit:(0,qt.deferred)(),exitTimeout:(0,qt.deferred)()},o=Promise.race([e===!1?ls:i.closeTimeout.promise,t===!1?ls:i.exitTimeout.promise]);return n(e,i.close,i.closeTimeout),n(t,i.exit,i.exitTimeout),{close(a){s=a,i.close.done()},exit(a){s=a,i.exit.done()},get exitCode(){return s},result:o}}function n(s,i,o){s!==!1&&(s===!0?i.promise:i.promise.then(()=>vr(s))).then(o.done)}return{type:"spawn.after",async action(s,{spawned:i,close:o}){let a=r(),l=!0,h=()=>void(l=!1);i.stdout?.on("data",h),i.stderr?.on("data",h),i.on("error",h),i.on("close",u=>a.close(u)),i.on("exit",u=>a.exit(u));try{await a.result,l&&await vr(50),o(a.exitCode)}catch(u){o(a.exitCode,u)}}}}O();var yl="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",hs="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function vl(e){return!e||!/^([a-z]:)?([a-z0-9/.\\_-]+)$/i.test(e)}function fs(e,t){if(e.length<1||e.length>2)throw new St(void 0,"binary",yl);if(e.some(vl))if(t)console.warn(hs);else throw new St(void 0,"binary",hs);let[n,s]=e;return{binary:n,prefix:s}}function Cl(e,t=["git"],r=!1){let n=fs(yt(t),r);e.on("binary",s=>{n=fs(yt(s),r)}),e.append("spawn.binary",()=>n.binary),e.append("spawn.args",s=>n.prefix?[n.prefix,...s]:s)}Rt();function wl(e){return!!(e.exitCode&&e.stdErr.length)}function kl(e){return Buffer.concat([...e.stdOut,...e.stdErr])}function Ol(e=!1,t=wl,r=kl){return(n,s)=>!e&&n||!t(s)?n:r(s)}function ps(e){return{type:"task.error",action(t,r){let n=e(t.error,{stdErr:r.stdErr,stdOut:r.stdOut,exitCode:r.exitCode});return Buffer.isBuffer(n)?{error:new At(void 0,n.toString("utf-8"))}:{error:n}}}}O();var xl=class{constructor(){this.plugins=new Set,this.events=new Tl}on(e,t){this.events.on(e,t)}reconfigure(e,t){this.events.emit(e,t)}append(e,t){let r=$(this.plugins,{type:e,action:t});return()=>this.plugins.delete(r)}add(e){let t=[];return yt(e).forEach(r=>r&&this.plugins.add($(t,r))),()=>{t.forEach(r=>this.plugins.delete(r))}}exec(e,t,r){let n=t,s=Object.freeze(Object.create(r));for(let i of this.plugins)i.type===e&&(n=i.action(n,s));return n}};O();function Sl(e){let t="--progress",r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(i,o){return r.includes(o.method)?Cs(i,t):i}},{type:"spawn.after",action(i,o){o.commands.includes(t)&&o.spawned.stderr?.on("data",a=>{let l=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(a.toString("utf8"));l&&e({method:o.method,stage:Al(l[1]),progress:L(l[2]),processed:L(l[3]),total:L(l[4])})})}}]}function Al(e){return String(e.toLowerCase().split(" ",1))||"unknown"}O();function El(e){let t=Os(e,["uid","gid"]);return{type:"spawn.options",action(r){return{...t,...r}}}}function $l({block:e,stdErr:t=!0,stdOut:r=!0}){if(e>0)return{type:"spawn.after",action(n,s){let i;function o(){i&&clearTimeout(i),i=setTimeout(l,e)}function a(){s.spawned.stdout?.off("data",o),s.spawned.stderr?.off("data",o),s.spawned.off("exit",a),s.spawned.off("close",a),i&&clearTimeout(i)}function l(){a(),s.kill(new St(void 0,"timeout","block timeout reached"))}r&&s.spawned.stdout?.on("data",o),t&&s.spawned.stderr?.on("data",o),s.spawned.on("exit",a),s.spawned.on("close",a),o()}}}Xt();function Rl(){return{type:"spawn.args",action(e){let t=[],r;function n(s){(r=r||[]).push(...s)}for(let s=0;s<e.length;s++){let i=e[s];if(we(i)){n(Ln(i));continue}if(i==="--"){n(e.slice(s+1).flatMap(o=>we(o)&&Ln(o)||o));break}t.push(i)}return r?[...t,"--",...r.map(String)]:t}}}O();var Fl=ll();function Ml(e,t){let r=new xl,n=Es(e&&(typeof e=="string"?{baseDir:e}:e)||{},t);if(!Lr(n.baseDir))throw new hl(n,"Cannot use simple-git on a directory that does not exist");return Array.isArray(n.config)&&r.add(_l(n.config)),r.add(gl(n.unsafe)),r.add(Rl()),r.add(bl(n.completion)),n.abort&&r.add(fl(n.abort)),n.progress&&r.add(Sl(n.progress)),n.timeout&&r.add($l(n.timeout)),n.spawnOptions&&r.add(El(n.spawnOptions)),r.add(ps(Ol(!0))),n.errors&&r.add(ps(n.errors)),Cl(r,n.binary,n.unsafe?.allowUnsafeCustomBinary),new Fl(n,r)}zt();var go=Ml;var bo="@lntvow/dev",yo="4.4.5";w();var nn=Tt(nr(),1);import ie from"fs";import Le from"path";import{fileURLToPath as Dl}from"url";var Pl=Dl(import.meta.url),Il=Le.dirname(Pl);function vo(e,t){ie.existsSync(t)||ie.mkdirSync(t),ie.readdirSync(e,{withFileTypes:!0}).forEach(n=>{let s=Le.resolve(e,n.name),i=Le.resolve(t,n.name);if(n.isDirectory())vo(s,i);else{if(ie.existsSync(i))return;ie.copyFileSync(s,i)}})}function Co(){console.log(nn.default.blue("Start copying template files")),vo(Le.resolve(Il,"./configs"),process.cwd()),console.log(nn.default.green("Template files copied successfully"))}sn.default.extend(wo.default);console.log(Ct.default.blue(`Cwd is ${process.cwd()}`));Jt.name(bo).version(yo,"-v, --version","output the version number");Jt.command("init").option("-t, --temp","copy template files",!0).option("--no-temp","not copy template files").option("-g, --git","init simple-git-hooks",!0).option("--no-git","not init simple-git-hooks").option("-s, --scripts","init scripts",!0).option("--no-scripts","not init scripts").description("init project").action(e=>{console.log(Ct.default.green("Init project by @lntvow/dev"));let{temp:t,git:r,scripts:n}=e;if(t&&Co(),r){console.log(Ct.default.blue("Start init simple-git-hooks"));let s=Ll("npx simple-git-hooks");console.log(s.toString())}if(n){console.log(Ct.default.blue("Start init scripts"));try{let s=Hl(process.cwd(),"package.json"),i=JSON.parse(jl(s,"utf-8"));i={...i,scripts:{postinstall:"simple-git-hooks",rimraf:"rimraf ./node_modules/",commit:"git add . && git-cz && git push",release:"git add . && bumpp package.json --all --no-tag --no-print-commits","lint:eslint":'eslint "src/**/*.{js,jsx,ts,tsx,vue}" --fix',"lint:tsc":"tsc --noEmit",lint:"run-p lint:eslint lint:tsc",ncu:"ncu -u && pnpm install",...i.scripts}},Nl(s,JSON.stringify(i,null,2)),console.log(Ct.default.green("Scripts added successfully"))}catch{console.log(Ct.default.yellow("No package.json file found ignoring scripts"))}}console.log(Ct.default.yellow(`
36
36
  You may need to re-execute the "pnpm install" command`))});Jt.command("release").description("git release").action(async()=>{console.log(Ct.default.green("Release project...")),await Bl()});Jt.parse();async function Bl(){let e=go(),t=(0,sn.default)().format("YYYYMMDD");await e.cwd(process.cwd()),await e.pull(),await e.add("."),await e.commit(t,"--no-verify"),await e.push("origin"),console.log(Ct.default.green(`Changes committed with message: ${t}`))}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lntvow/dev",
3
- "version": "4.4.4",
3
+ "version": "4.4.5",
4
4
  "type": "module",
5
5
  "description": "开发环境依赖包",
6
6
  "keywords": [