@lntvow/dev 4.3.7 → 4.3.8

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