@lntvow/dev 4.3.5 → 4.3.6

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,Ga=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,Va=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,Wa=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,qa=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(...Ua(e)),n}function Ua(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 za=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 Ya=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(),Ga(),Va(),Wa(),qa(),za(),Ya(),De()}}),js={};W(js,{CheckRepoActions:()=>Er,checkIsBareRepoTask:()=>Hs,checkIsRepoRootTask:()=>Ns,checkIsRepoTask:()=>Ja});function Ja(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 Ka(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&&Ka(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 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,Za=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:()=>Xa,isCleanOptionsArray:()=>tu});function Xa(e,t){let{cleanMode:r,options:n,valid:s}=eu(e);return r?s.options?(n.push(...t),n.some(su)?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 Qa(e==="n",n)}}}function tu(e){return Array.isArray(e)&&e.every(t=>Kr.has(t))}function eu(e){let t,r=[],n={cleanMode:!1,options:!0};return e.replace(/[^a-z]i/g,"").split("").forEach(s=>{ru(s)?(t=s,n.cleanMode=!0):n.options=n.options&&nu(r[r.length]=`-${s}`)}),{cleanMode:t,options:r,valid:n}}function ru(e){return e==="f"||e==="n"}function nu(e){return/^-[a-z]$/i.test(e)&&Kr.has(e.charAt(1))}function su(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";Za(),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 iu(e){let t=new ti;for(let r of Xs(e))t.addValue(r.file,String(r.key),r.value);return t}function ou(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 au(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=au(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,uu=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 cu(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 lu(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 ou(n,e)}}}function hu(e){let t=["config","--list","--show-origin","--null"];return e&&t.push(`--${e}`),{commands:t,format:"utf-8",parser(r){return iu(r)}}}function fu(){return{addConfig(e,t,...r){return this._runTask(cu(e,t,r[0]===!0,yr(r[1],"local")),G(arguments))},getConfig(e,t){return this._runTask(lu(e,yr(t,void 0)),G(arguments))},listConfig(...e){return this._runTask(hu(yr(e[0],void 0)),G(arguments))}}}var Rr,ei=d({"src/lib/tasks/config.ts"(){"use strict";uu(),O(),Rr=(e=>(e.system="system",e.global="global",e.local="local",e.worktree="worktree",e))(Rr||{})}});function pu(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 mu(...e){return new ii().param(...e)}function du(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 gu(){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=mu().param(e));let n=["grep","--null","-n","--full-name",...r,...e];return this._runTask({commands:n,format:"utf-8",parser(s){return du(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:()=>bu,resetTask:()=>_u});function _u(e,t){let r=["reset"];return ui(e)&&r.push(`--${e}`),r.push(...t),st(r)}function bu(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 yu(){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 vu(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=yu()){let s=e&&`[${e}]`||"",i=[],o=typeof t=="string"?n.extend(t):t,a=vu(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,Cu=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 wu(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,ku=d({"src/lib/runners/git-executor-chain.ts"(){"use strict";$t(),V(),O(),Cu(),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",wu(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,Ou=d({"src/lib/runners/git-executor.ts"(){"use strict";ku(),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 Tu(e,t,r=Lt){let n=i=>{r(null,i)},s=i=>{i?.task===e&&r(i instanceof ne?xu(i):i,void 0)};t.then(n,s)}function xu(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 Su=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 Au=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 Eu(){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 $u=d({"src/lib/tasks/checkout.ts"(){"use strict";O(),V()}});function Ru(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}function Fu(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser(e){return ct(Ru(),[di],e)}})}}}var di,Mu=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 Pu(e){return ct({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},gi,e)}var gi,Du=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 Iu(e,t,r){return{commands:["-c","core.abbrev=40","commit",...Xt(e,"-m"),...t,...r],format:"utf-8",parser:Pu}}function Lu(){return{commit(t,...r){let n=G(arguments),s=e(t)||Iu(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 ju=d({"src/lib/tasks/commit.ts"(){"use strict";Du(),O(),V()}});function Nu(){return{firstCommit(){return this._runTask(st(["rev-list","--max-parents=0","HEAD"],!0),G(arguments))}}}var Hu=d({"src/lib/tasks/first-commit.ts"(){"use strict";O(),V()}});function Bu(e,t){let r=["hash-object",e];return t&&r.push("-w"),st(r,!0)}var Gu=d({"src/lib/tasks/hash-object.ts"(){"use strict";V()}});function Vu(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,Wu=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 qu(e){return e.includes(Zr)}function Uu(e=!1,t,r){let n=["init",...r];return e&&!qu(n)&&n.splice(1,0,Zr),{commands:n,format:"utf-8",parser(s){return Vu(n.includes("--bare"),t,s)}}}var Zr,zu=d({"src/lib/tasks/init.ts"(){"use strict";Wu(),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 Yu(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,Ju=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(),Ju(),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(pu(t)&&t),from:xr(!!i&&n!==i&&n),similarity:j(r)})})],Ci={"":wr,"--stat":wr,"--numstat":Yn,"--name-status":Kn,"--name-only":Jn}}});function Ku(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=Ku(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:()=>Qu,validateLogFormatConfig:()=>je});function Qu(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(Yu);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 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 Xu(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]=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 tt(e.file)&&a.push("--follow",Ba(e.file)),Wr(Xu(e),a),{fields:s,splitter:r,commands:[...a,...o]}}function tc(e,t,r){let n=ki(e,t,Xr(r));return{commands:["log",...r],format:"utf-8",parser:n}}function ec(){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 tc(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,rc=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,nc=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,sc=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(),sc(),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 ic(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";nc(),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,oc=d({"src/lib/parsers/parse-merge.ts"(){"use strict";rc(),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 ac=d({"src/lib/tasks/merge.ts"(){"use strict";Ut(),oc(),V()}});function uc(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,cc=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(uc(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:()=>lc,pushTask:()=>an});function lc(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";cc(),O()}});function hc(){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 fc=d({"src/lib/tasks/show.ts"(){"use strict";O(),V()}}),us,Gi,pc=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 mc(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,dc=d({"src/lib/responses/StatusSummary.ts"(){"use strict";O(),pc(),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++]||"")),mc(r,i))}return r}}});function gc(e){return{format:"utf-8",commands:["status","--porcelain","-b","-u","--null",...e.filter(r=>!qi.includes(r))],parser(r){return Wi(r)}}}var qi,_c=d({"src/lib/tasks/status.ts"(){"use strict";dc(),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 bc(){return $e(0,0,0,"",!1)}function yc(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:vc,onError(e,t,r,n){if(e.exitCode===-2)return r(Buffer.from(un));n(t)}})}}}function vc(e){return e===un?bc():ct($e(0,0,0,e),Ui,e)}var un,Ui,Cc=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,wc=d({"src/lib/simple-git-api.ts"(){"use strict";Su(),Au(),$u(),Mu(),ju(),ei(),Hu(),oi(),Gu(),zu(),Ai(),ac(),Bi(),fc(),_c(),V(),Cc(),O(),Ir=class{constructor(e){this._executor=e}_runTask(e,t){let r=this._executor.chain(),n=r.push(e);return t&&Tu(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(Bu(e,t===!0),G(arguments))}init(e){return this._runTask(Uu(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(gc(at(arguments)),G(arguments))}},Object.assign(Ir.prototype,Eu(),Lu(),fu(),Fu(),Nu(),gu(),ec(),hc(),yc())}}),Yi={};W(Yi,{Scheduler:()=>Ki});var hs,Ki,kc=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:()=>Oc});function Oc(e,t){return st(["apply",...t,...e])}var Tc=d({"src/lib/tasks/apply-patch.ts"(){"use strict";V()}});function xc(e,t){return{branch:e,hash:t,success:!0}}function Sc(e){return{branch:e,hash:null,success:!1}}var Zi,Ac=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,Ec=d({"src/lib/parsers/parse-branch-delete.ts"(){"use strict";Ac(),O(),fs=/(\S+)\s+\(\S+\s([^)]+)\)/,Lr=/^error[^']+'([^']+)'/m,ps=[new S(fs,(e,[t,r])=>{let n=xc(t,r);e.all.push(n),e.branches[t]=n}),new S(Lr,(e,[t])=>{let r=Sc(t);e.errors.push(r),e.all.push(r),e.branches[t]=r})],Ne=(e,t)=>ct(new Zi,ps,[e,t])}}),to,$c=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,Rc=d({"src/lib/parsers/parse-branch.ts"(){"use strict";$c(),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:()=>Mc,branchTask:()=>Fc,containsDeleteBranchCommand:()=>so,deleteBranchTask:()=>Dc,deleteBranchesTask:()=>Pc});function so(e){let t=["-d","-D","--delete"];return e.some(r=>t.includes(r))}function Fc(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 Mc(){return{format:"utf-8",commands:["branch","-v"],parser:eo}}function Pc(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 Dc(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 Ic=d({"src/lib/tasks/branch.ts"(){"use strict";Ut(),Ec(),Rc(),O()}}),io,Lc=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:()=>jc});function jc(e){return{commands:["check-ignore",...e],format:"utf-8",parser:io}}var Nc=d({"src/lib/tasks/check-ignore.ts"(){"use strict";Lc()}}),ao={};W(ao,{cloneMirrorTask:()=>Bc,cloneTask:()=>uo});function Hc(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(Hc)?ut("git.fetch: potential exploit argument blocked."):st(n)}function Bc(e,t,r){return $(r,"--mirror"),uo(e,t,r)}var Gc=d({"src/lib/tasks/clone.ts"(){"use strict";V(),O()}});function Vc(e,t){return ct({raw:e,remote:null,branches:[],tags:[],updated:[],deleted:[]},co,[e,t])}var co,Wc=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:()=>Uc});function qc(e){return/^--upload-pack(=|$)/.test(e)}function Uc(e,t,r){let n=["fetch",...r];return e&&t&&n.push(e,t),n.find(qc)?ut("git.fetch: potential exploit argument blocked."):{commands:n,format:"utf-8",parser:Vc}}var zc=d({"src/lib/tasks/fetch.ts"(){"use strict";Wc(),V()}});function Yc(e){return ct({moves:[]},ho,e)}var ho,Jc=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:()=>Kc});function Kc(e,t){return{commands:["mv","-v",...vt(e),t],format:"utf-8",parser:Yc}}var Qc=d({"src/lib/tasks/move.ts"(){"use strict";Jc(),O()}}),po={};W(po,{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=ic(te(s.stdOut),te(s.stdErr));if(h)return a(new ne(h));a(i)}}}var Xc=d({"src/lib/tasks/pull.ts"(){"use strict";Ut(),Li(),O()}});function tl(e){let t={};return mo(e,([r])=>t[r]={name:r}),Object.values(t)}function el(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 rl=d({"src/lib/responses/GetRemoteSummary.ts"(){"use strict";O()}}),go={};W(go,{addRemoteTask:()=>nl,getRemotesTask:()=>sl,listRemotesTask:()=>il,remoteTask:()=>ol,removeRemoteTask:()=>al});function nl(e,t,r){return st(["remote","add",...r,e,t])}function sl(e){let t=["remote"];return e&&t.push("-v"),{commands:t,format:"utf-8",parser:e?el:tl}}function il(e){let t=[...e];return t[0]!=="ls-remote"&&t.unshift("ls-remote"),st(t)}function ol(e){let t=[...e];return t[0]!=="remote"&&t.unshift("remote"),st(t)}function al(e){return st(["remote","remove",e])}var ul=d({"src/lib/tasks/remote.ts"(){"use strict";rl(),V()}}),_o={};W(_o,{stashListTask:()=>cl});function cl(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 ll=d({"src/lib/tasks/stash-list.ts"(){"use strict";ae(),Ti(),sn(),Ai()}}),bo={};W(bo,{addSubModuleTask:()=>hl,initSubModuleTask:()=>fl,subModuleTask:()=>He,updateSubModuleTask:()=>pl});function hl(e,t){return He(["add",e,t])}function fl(e){return He(["init",...e])}function He(e){let t=[...e];return t[0]!=="submodule"&&t.unshift("submodule"),st(t)}function pl(e){return He(["update",...e])}var ml=d({"src/lib/tasks/sub-module.ts"(){"use strict";V()}});function dl(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 gl(e){return e.trim()}function we(e){return typeof e=="string"&&parseInt(e.replace(/^\D+/g,""),10)||0}var ds,vo,_l=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(gl).filter(Boolean);t||r.sort(function(s,i){let o=s.split("."),a=i.split(".");if(o.length===1||a.length===1)return dl(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:()=>vl,addTagTask:()=>yl,tagListTask:()=>bl});function bl(e=[]){let t=e.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...e],parser(r){return vo(r,t)}}}function yl(e){return{format:"utf-8",commands:["tag",e],parser(){return{name:e}}}}function vl(e,t){return{format:"utf-8",commands:["tag","-a","-m",t,e],parser(){return{name:e}}}}var Cl=d({"src/lib/tasks/tag.ts"(){"use strict";_l()}}),wl=Na({"src/git.js"(e,t){"use strict";var{GitExecutor:r}=(Ou(),B(pi)),{SimpleGitApi:n}=(wc(),B(zi)),{Scheduler:s}=(kc(),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}=(Tc(),B(Qi)),{branchTask:I,branchLocalTask:N,deleteBranchesTask:J,deleteBranchTask:q}=(Ic(),B(no)),{checkIgnoreTask:Y}=(Nc(),B(oo)),{checkIsRepoTask:pt}=(Bs(),B(js)),{cloneTask:et,cloneMirrorTask:lt}=(Gc(),B(ao)),{cleanWithOptionsTask:F,isCleanOptionsArray:E}=(Zs(),B(Ks)),{diffSummaryTask:jt}=(sn(),B(xi)),{fetchTask:le}=(zc(),B(lo)),{moveTask:k}=(Qc(),B(fo)),{pullTask:b}=(Xc(),B(po)),{pushTagsTask:g}=(Bi(),B(Hi)),{addRemoteTask:v,getRemotesTask:_,listRemotesTask:T,remoteTask:x,removeRemoteTask:P}=(ul(),B(go)),{getResetMode:H,resetTask:U}=(li(),B(ai)),{stashListTask:K}=(ll(),B(_o)),{addSubModuleTask:it,initSubModuleTask:At,subModuleTask:wt,updateSubModuleTask:Rt}=(ml(),B(bo)),{addAnnotatedTagTask:kt,addTagTask:Z,tagListTask:yt}=(Cl(),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 kl=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 Ol(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 Tl(e){return typeof e=="string"&&e.trim().toLowerCase()==="-c"}function xl(e,t){if(Tl(e)&&/^\s*protocol(.[a-z]+)?.allow/.test(t))throw new Tt(void 0,"unsafe","Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol")}function Sl(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 Al({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||xl(s,o),t||Sl(s,n.method)}),r}}}O();function El(e){let t=Xt(e,"-c");return{type:"spawn.args",action(r){return[...t,...r]}}}O();var gs=(0,Wt.deferred)().promise;function $l({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 Rl="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 Fl(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",Rl);if(e.some(Fl))if(t)console.warn(_s);else throw new Tt(void 0,"binary",_s);let[n,s]=e;return{binary:n,prefix:s}}function Ml(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 Pl(e){return!!(e.exitCode&&e.stdErr.length)}function Dl(e){return Buffer.concat([...e.stdOut,...e.stdErr])}function Il(e=!1,t=Pl,r=Dl){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 Ll=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 jl(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:Nl(l[1]),progress:j(l[2]),processed:j(l[3]),total:j(l[4])})}))}}]}function Nl(e){return String(e.toLowerCase().split(" ",1))||"unknown"}O();function Hl(e){let t=Rs(e,["uid","gid"]);return{type:"spawn.options",action(r){return dt(dt({},t),r)}}}function Bl({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 Gl(){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 Vl=wl();function Wl(e,t){var r;let n=new Ll,s=Ds(e&&(typeof e=="string"?{baseDir:e}:e)||{},t);if(!Hr(s.baseDir))throw new kl(s,"Cannot use simple-git on a directory that does not exist");return Array.isArray(s.config)&&n.add(El(s.config)),n.add(Al(s.unsafe)),n.add(Gl()),n.add($l(s.completion)),s.abort&&n.add(Ol(s.abort)),s.progress&&n.add(jl(s.progress)),s.timeout&&n.add(Bl(s.timeout)),s.spawnOptions&&n.add(Hl(s.spawnOptions)),n.add(ys(Il(!0))),s.errors&&n.add(ys(s.errors)),Ml(n,s.binary,(r=s.unsafe)==null?void 0:r.allowUnsafeCustomBinary),new Vl(s,n)}Ut();var ko=Wl;var To="@lntvow/dev",xo="4.3.5";w();var zt=_t(require("fs"),1),ue=_t(require("path"),1),So=require("url"),Be=_t(ur(),1),ql=(0,So.fileURLToPath)(L),Ul=ue.default.dirname(ql),[Ao]=process.cwd().split("node_modules");console.log("process.cwd(): ",process.cwd());console.log(Be.default.blue(`Cwd is: ${Ao}`));function Eo(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())Eo(s,i);else{if(zt.default.existsSync(i))return;zt.default.copyFileSync(s,i)}})}function $o(){console.log(Be.default.blue("Start copying template files")),Eo(ue.default.resolve(Ul,"./configs"),Ao),console.log(Be.default.green("Template files copied successfully"))}cn.default.extend(Mo.default);var zl=(0,Fo.fileURLToPath)(L),Yl=(0,ce.dirname)(zl),Jl=(0,ce.resolve)(Yl,"../");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&&$o(),r){console.log(St.default.blue("Start init simple-git-hooks"));let s=(0,Ro.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(gl).filter(Boolean);t||r.sort(function(s,i){let o=s.split("."),a=i.split(".");if(o.length===1||a.length===1)return dl(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:()=>vl,addTagTask:()=>yl,tagListTask:()=>bl});function bl(e=[]){let t=e.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...e],parser(r){return vo(r,t)}}}function yl(e){return{format:"utf-8",commands:["tag",e],parser(){return{name:e}}}}function vl(e,t){return{format:"utf-8",commands:["tag","-a","-m",t,e],parser(){return{name:e}}}}var Cl=d({"src/lib/tasks/tag.ts"(){"use strict";_l()}}),wl=Na({"src/git.js"(e,t){"use strict";var{GitExecutor:r}=(Ou(),B(pi)),{SimpleGitApi:n}=(wc(),B(zi)),{Scheduler:s}=(kc(),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}=(Tc(),B(Qi)),{branchTask:I,branchLocalTask:N,deleteBranchesTask:J,deleteBranchTask:q}=(Ic(),B(no)),{checkIgnoreTask:Y}=(Nc(),B(oo)),{checkIsRepoTask:pt}=(Bs(),B(js)),{cloneTask:et,cloneMirrorTask:lt}=(Gc(),B(ao)),{cleanWithOptionsTask:F,isCleanOptionsArray:E}=(Zs(),B(Ks)),{diffSummaryTask:jt}=(sn(),B(xi)),{fetchTask:le}=(zc(),B(lo)),{moveTask:k}=(Qc(),B(fo)),{pullTask:b}=(Xc(),B(po)),{pushTagsTask:g}=(Bi(),B(Hi)),{addRemoteTask:v,getRemotesTask:_,listRemotesTask:T,remoteTask:x,removeRemoteTask:P}=(ul(),B(go)),{getResetMode:H,resetTask:U}=(li(),B(ai)),{stashListTask:K}=(ll(),B(_o)),{addSubModuleTask:it,initSubModuleTask:At,subModuleTask:wt,updateSubModuleTask:Rt}=(ml(),B(bo)),{addAnnotatedTagTask:kt,addTagTask:Z,tagListTask:yt}=(Cl(),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 kl=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 Ol(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 Tl(e){return typeof e=="string"&&e.trim().toLowerCase()==="-c"}function xl(e,t){if(Tl(e)&&/^\s*protocol(.[a-z]+)?.allow/.test(t))throw new Tt(void 0,"unsafe","Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol")}function Sl(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 Al({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||xl(s,o),t||Sl(s,n.method)}),r}}}O();function El(e){let t=Xt(e,"-c");return{type:"spawn.args",action(r){return[...t,...r]}}}O();var gs=(0,Wt.deferred)().promise;function $l({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 Rl="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 Fl(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",Rl);if(e.some(Fl))if(t)console.warn(_s);else throw new Tt(void 0,"binary",_s);let[n,s]=e;return{binary:n,prefix:s}}function Ml(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 Pl(e){return!!(e.exitCode&&e.stdErr.length)}function Dl(e){return Buffer.concat([...e.stdOut,...e.stdErr])}function Il(e=!1,t=Pl,r=Dl){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 Ll=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 jl(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:Nl(l[1]),progress:j(l[2]),processed:j(l[3]),total:j(l[4])})}))}}]}function Nl(e){return String(e.toLowerCase().split(" ",1))||"unknown"}O();function Hl(e){let t=Rs(e,["uid","gid"]);return{type:"spawn.options",action(r){return dt(dt({},t),r)}}}function Bl({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 Gl(){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 Vl=wl();function Wl(e,t){var r;let n=new Ll,s=Ds(e&&(typeof e=="string"?{baseDir:e}:e)||{},t);if(!Hr(s.baseDir))throw new kl(s,"Cannot use simple-git on a directory that does not exist");return Array.isArray(s.config)&&n.add(El(s.config)),n.add(Al(s.unsafe)),n.add(Gl()),n.add($l(s.completion)),s.abort&&n.add(Ol(s.abort)),s.progress&&n.add(jl(s.progress)),s.timeout&&n.add(Bl(s.timeout)),s.spawnOptions&&n.add(Hl(s.spawnOptions)),n.add(ys(Il(!0))),s.errors&&n.add(ys(s.errors)),Ml(n,s.binary,(r=s.unsafe)==null?void 0:r.allowUnsafeCustomBinary),new Vl(s,n)}Ut();var ko=Wl;var To="@lntvow/dev",xo="4.3.6";w();var zt=_t(require("fs"),1),ue=_t(require("path"),1),So=require("url"),Be=_t(ur(),1),ql=(0,So.fileURLToPath)(L),Ul=ue.default.dirname(ql),[Ao]=process.cwd().split("node_modules");console.log("process.cwd(): ",process.cwd());console.log(Be.default.blue(`Cwd is: ${Ao}`));function Eo(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())Eo(s,i);else{if(zt.default.existsSync(i))return;zt.default.copyFileSync(s,i)}})}function $o(){console.log(Be.default.blue("Start copying template files")),Eo(ue.default.resolve(Ul,"./configs"),Ao),console.log(Be.default.green("Template files copied successfully"))}cn.default.extend(Mo.default);var zl=(0,Fo.fileURLToPath)(L),Yl=(0,ce.dirname)(zl),Jl=(0,ce.resolve)(Yl,"../");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&&$o(),r){console.log(St.default.blue("Start init simple-git-hooks"));let s=(0,Ro.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 Kl()});Jt.parse();async function Kl(){let e=ko(),t=(0,cn.default)().format("YYYYMMDD");await e.cwd(Jl),await e.pull(),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,La=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,ja=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,Na=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,Ha=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(...Ba(e)),n}function Ba(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 Ga=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 Va=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(),La(),ja(),Na(),Ha(),Ga(),Va(),De()}}),js={};q(js,{CheckRepoActions:()=>Er,checkIsBareRepoTask:()=>Hs,checkIsRepoRootTask:()=>Ns,checkIsRepoTask:()=>Wa});function Wa(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 qa(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&&qa(t))return r(Buffer.from("false"));n(t)},Ur=e=>e.trim()==="true"}});function Ua(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,za=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:()=>Ya,isCleanOptionsArray:()=>Ja});function Ya(e,t){let{cleanMode:r,options:n,valid:s}=Ka(e);return r?s.options?(n.push(...t),n.some(Xa)?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 Ua(e==="n",n)}}}function Ja(e){return Array.isArray(e)&&e.every(t=>Kr.has(t))}function Ka(e){let t,r=[],n={cleanMode:!1,options:!0};return e.replace(/[^a-z]i/g,"").split("").forEach(s=>{Qa(s)?(t=s,n.cleanMode=!0):n.options=n.options&&Za(r[r.length]=`-${s}`)}),{cleanMode:t,options:r,valid:n}}function Qa(e){return e==="f"||e==="n"}function Za(e){return/^-[a-z]$/i.test(e)&&Kr.has(e.charAt(1))}function Xa(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";za(),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 tu(e){let t=new ti;for(let r of Xs(e))t.addValue(r.file,String(r.key),r.value);return t}function eu(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 ru(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=ru(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,nu=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 su(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 iu(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 eu(n,e)}}}function ou(e){let t=["config","--list","--show-origin","--null"];return e&&t.push(`--${e}`),{commands:t,format:"utf-8",parser(r){return tu(r)}}}function au(){return{addConfig(e,t,...r){return this._runTask(su(e,t,r[0]===!0,yr(r[1],"local")),B(arguments))},getConfig(e,t){return this._runTask(iu(e,yr(t,void 0)),B(arguments))},listConfig(...e){return this._runTask(ou(yr(e[0],void 0)),B(arguments))}}}var Rr,ei=d({"src/lib/tasks/config.ts"(){"use strict";nu(),O(),Rr=(e=>(e.system="system",e.global="global",e.local="local",e.worktree="worktree",e))(Rr||{})}});function uu(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 cu(...e){return new ii().param(...e)}function lu(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 hu(){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=cu().param(e));let n=["grep","--null","-n","--full-name",...r,...e];return this._runTask({commands:n,format:"utf-8",parser(s){return lu(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:()=>pu,resetTask:()=>fu});function fu(e,t){let r=["reset"];return ui(e)&&r.push(`--${e}`),r.push(...t),it(r)}function pu(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 mu(){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 du(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=mu()){let s=e&&`[${e}]`||"",i=[],o=typeof t=="string"?n.extend(t):t,a=du(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,gu=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 bu(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,yu=d({"src/lib/runners/git-executor-chain.ts"(){"use strict";Ft(),W(),O(),gu(),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=_u(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",bu(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,vu=d({"src/lib/runners/git-executor.ts"(){"use strict";yu(),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 Cu(e,t,r=Nt){let n=i=>{r(null,i)},s=i=>{i?.task===e&&r(i instanceof se?wu(i):i,void 0)};t.then(n,s)}function wu(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 ku=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 Ou=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 Tu(){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 xu=d({"src/lib/tasks/checkout.ts"(){"use strict";O(),W()}});function Su(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}function Au(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser(e){return lt(Su(),[mi],e)}})}}}var mi,Eu=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 $u(e){return lt({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},di,e)}var di,Ru=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 Fu(e,t,r){return{commands:["-c","core.abbrev=40","commit",...te(e,"-m"),...t,...r],format:"utf-8",parser:$u}}function Mu(){return{commit(t,...r){let n=B(arguments),s=e(t)||Fu(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 Pu=d({"src/lib/tasks/commit.ts"(){"use strict";Ru(),O(),W()}});function Du(){return{firstCommit(){return this._runTask(it(["rev-list","--max-parents=0","HEAD"],!0),B(arguments))}}}var Iu=d({"src/lib/tasks/first-commit.ts"(){"use strict";O(),W()}});function Lu(e,t){let r=["hash-object",e];return t&&r.push("-w"),it(r,!0)}var ju=d({"src/lib/tasks/hash-object.ts"(){"use strict";W()}});function Nu(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,Hu=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 Bu(e){return e.includes(Zr)}function Gu(e=!1,t,r){let n=["init",...r];return e&&!Bu(n)&&n.splice(1,0,Zr),{commands:n,format:"utf-8",parser(s){return Nu(n.includes("--bare"),t,s)}}}var Zr,Vu=d({"src/lib/tasks/init.ts"(){"use strict";Hu(),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 Wu(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,qu=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(),qu(),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(uu(t)&&t),from:xr(!!i&&n!==i&&n),similarity:L(r)})})],vi={"":wr,"--stat":wr,"--numstat":Yn,"--name-status":Kn,"--name-only":Jn}}});function Uu(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=Uu(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:()=>zu,validateLogFormatConfig:()=>je});function zu(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(Wu);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 Yu(e,t){let r=[],n=[];return Object.keys(e).forEach(s=>{r.push(s),n.push(String(e[s]))}),[r,n.join(t)]}function Ju(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]=Yu(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",Ia(e.file)),Wr(Ju(e),a),{fields:s,splitter:r,commands:[...a,...o]}}function Ku(e,t,r){let n=wi(e,t,Xr(r));return{commands:["log",...r],format:"utf-8",parser:n}}function Qu(){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 Ku(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,Zu=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,Xu=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,tc=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(),tc(),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 ec(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";Xu(),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,rc=d({"src/lib/parsers/parse-merge.ts"(){"use strict";Zu(),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 nc=d({"src/lib/tasks/merge.ts"(){"use strict";Yt(),rc(),W()}});function sc(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,ic=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(sc(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:()=>oc,pushTask:()=>an});function oc(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";ic(),O()}});function ac(){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 uc=d({"src/lib/tasks/show.ts"(){"use strict";O(),W()}}),us,Bi,cc=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 lc(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,hc=d({"src/lib/responses/StatusSummary.ts"(){"use strict";O(),cc(),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++]||"")),lc(r,i))}return r}}});function fc(e){return{format:"utf-8",commands:["status","--porcelain","-b","-u","--null",...e.filter(r=>!Wi.includes(r))],parser(r){return Vi(r)}}}var Wi,pc=d({"src/lib/tasks/status.ts"(){"use strict";hc(),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 mc(){return $e(0,0,0,"",!1)}function dc(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:gc,onError(e,t,r,n){if(e.exitCode===-2)return r(Buffer.from(un));n(t)}})}}}function gc(e){return e===un?mc():lt($e(0,0,0,e),qi,e)}var un,qi,_c=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,bc=d({"src/lib/simple-git-api.ts"(){"use strict";ku(),Ou(),xu(),Eu(),Pu(),ei(),Iu(),oi(),ju(),Vu(),Si(),nc(),Hi(),uc(),pc(),W(),_c(),O(),Ir=class{constructor(e){this._executor=e}_runTask(e,t){let r=this._executor.chain(),n=r.push(e);return t&&Cu(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(Lu(e,t===!0),B(arguments))}init(e){return this._runTask(Gu(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(fc(ut(arguments)),B(arguments))}},Object.assign(Ir.prototype,Tu(),Mu(),au(),Au(),Du(),hu(),Qu(),ac(),dc())}}),zi={};q(zi,{Scheduler:()=>Ji});var hs,Ji,yc=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:()=>vc});function vc(e,t){return it(["apply",...t,...e])}var Cc=d({"src/lib/tasks/apply-patch.ts"(){"use strict";W()}});function wc(e,t){return{branch:e,hash:t,success:!0}}function kc(e){return{branch:e,hash:null,success:!1}}var Qi,Oc=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,Tc=d({"src/lib/parsers/parse-branch-delete.ts"(){"use strict";Oc(),O(),fs=/(\S+)\s+\(\S+\s([^)]+)\)/,Lr=/^error[^']+'([^']+)'/m,ps=[new S(fs,(e,[t,r])=>{let n=wc(t,r);e.all.push(n),e.branches[t]=n}),new S(Lr,(e,[t])=>{let r=kc(t);e.errors.push(r),e.all.push(r),e.branches[t]=r})],Ne=(e,t)=>lt(new Qi,ps,[e,t])}}),Xi,xc=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,Sc=d({"src/lib/parsers/parse-branch.ts"(){"use strict";xc(),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:()=>Ec,branchTask:()=>Ac,containsDeleteBranchCommand:()=>no,deleteBranchTask:()=>Rc,deleteBranchesTask:()=>$c});function no(e){let t=["-d","-D","--delete"];return e.some(r=>t.includes(r))}function Ac(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 Ec(){return{format:"utf-8",commands:["branch","-v"],parser:to}}function $c(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 Rc(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 Fc=d({"src/lib/tasks/branch.ts"(){"use strict";Yt(),Tc(),Sc(),O()}}),so,Mc=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:()=>Pc});function Pc(e){return{commands:["check-ignore",...e],format:"utf-8",parser:so}}var Dc=d({"src/lib/tasks/check-ignore.ts"(){"use strict";Mc()}}),oo={};q(oo,{cloneMirrorTask:()=>Lc,cloneTask:()=>ao});function Ic(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(Ic)?ct("git.fetch: potential exploit argument blocked."):it(n)}function Lc(e,t,r){return $(r,"--mirror"),ao(e,t,r)}var jc=d({"src/lib/tasks/clone.ts"(){"use strict";W(),O()}});function Nc(e,t){return lt({raw:e,remote:null,branches:[],tags:[],updated:[],deleted:[]},uo,[e,t])}var uo,Hc=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:()=>Gc});function Bc(e){return/^--upload-pack(=|$)/.test(e)}function Gc(e,t,r){let n=["fetch",...r];return e&&t&&n.push(e,t),n.find(Bc)?ct("git.fetch: potential exploit argument blocked."):{commands:n,format:"utf-8",parser:Nc}}var Vc=d({"src/lib/tasks/fetch.ts"(){"use strict";Hc(),W()}});function Wc(e){return lt({moves:[]},lo,e)}var lo,qc=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:()=>Uc});function Uc(e,t){return{commands:["mv","-v",...vt(e),t],format:"utf-8",parser:Wc}}var zc=d({"src/lib/tasks/move.ts"(){"use strict";qc(),O()}}),fo={};q(fo,{pullTask:()=>Yc});function Yc(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=ec(ee(s.stdOut),ee(s.stdErr));if(h)return a(new se(h));a(i)}}}var Jc=d({"src/lib/tasks/pull.ts"(){"use strict";Yt(),Ii(),O()}});function Kc(e){let t={};return po(e,([r])=>t[r]={name:r}),Object.values(t)}function Qc(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 Zc=d({"src/lib/responses/GetRemoteSummary.ts"(){"use strict";O()}}),mo={};q(mo,{addRemoteTask:()=>Xc,getRemotesTask:()=>tl,listRemotesTask:()=>el,remoteTask:()=>rl,removeRemoteTask:()=>nl});function Xc(e,t,r){return it(["remote","add",...r,e,t])}function tl(e){let t=["remote"];return e&&t.push("-v"),{commands:t,format:"utf-8",parser:e?Qc:Kc}}function el(e){let t=[...e];return t[0]!=="ls-remote"&&t.unshift("ls-remote"),it(t)}function rl(e){let t=[...e];return t[0]!=="remote"&&t.unshift("remote"),it(t)}function nl(e){return it(["remote","remove",e])}var sl=d({"src/lib/tasks/remote.ts"(){"use strict";Zc(),W()}}),go={};q(go,{stashListTask:()=>il});function il(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 ol=d({"src/lib/tasks/stash-list.ts"(){"use strict";ue(),Oi(),sn(),Si()}}),_o={};q(_o,{addSubModuleTask:()=>al,initSubModuleTask:()=>ul,subModuleTask:()=>He,updateSubModuleTask:()=>cl});function al(e,t){return He(["add",e,t])}function ul(e){return He(["init",...e])}function He(e){let t=[...e];return t[0]!=="submodule"&&t.unshift("submodule"),it(t)}function cl(e){return He(["update",...e])}var ll=d({"src/lib/tasks/sub-module.ts"(){"use strict";W()}});function hl(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 fl(e){return e.trim()}function we(e){return typeof e=="string"&&parseInt(e.replace(/^\D+/g,""),10)||0}var ds,yo,pl=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(fl).filter(Boolean);t||r.sort(function(s,i){let o=s.split("."),a=i.split(".");if(o.length===1||a.length===1)return hl(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:()=>gl,addTagTask:()=>dl,tagListTask:()=>ml});function ml(e=[]){let t=e.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...e],parser(r){return yo(r,t)}}}function dl(e){return{format:"utf-8",commands:["tag",e],parser(){return{name:e}}}}function gl(e,t){return{format:"utf-8",commands:["tag","-a","-m",t,e],parser(){return{name:e}}}}var _l=d({"src/lib/tasks/tag.ts"(){"use strict";pl()}}),bl=Pa({"src/git.js"(e,t){"use strict";var{GitExecutor:r}=(vu(),H(fi)),{SimpleGitApi:n}=(bc(),H(Ui)),{Scheduler:s}=(yc(),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}=(Cc(),H(Ki)),{branchTask:I,branchLocalTask:j,deleteBranchesTask:K,deleteBranchTask:U}=(Fc(),H(ro)),{checkIgnoreTask:J}=(Dc(),H(io)),{checkIsRepoTask:mt}=(Bs(),H(js)),{cloneTask:rt,cloneMirrorTask:ht}=(jc(),H(oo)),{cleanWithOptionsTask:F,isCleanOptionsArray:E}=(Zs(),H(Ks)),{diffSummaryTask:Ht}=(sn(),H(Ti)),{fetchTask:le}=(Vc(),H(co)),{moveTask:k}=(zc(),H(ho)),{pullTask:b}=(Jc(),H(fo)),{pushTagsTask:g}=(Hi(),H(Ni)),{addRemoteTask:v,getRemotesTask:_,listRemotesTask:T,remoteTask:x,removeRemoteTask:P}=(sl(),H(mo)),{getResetMode:N,resetTask:z}=(li(),H(ai)),{stashListTask:Q}=(ol(),H(go)),{addSubModuleTask:ot,initSubModuleTask:$t,subModuleTask:wt,updateSubModuleTask:Mt}=(ll(),H(_o)),{addAnnotatedTagTask:kt,addTagTask:X,tagListTask:yt}=(_l(),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 yl=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 vl(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 Cl(e){return typeof e=="string"&&e.trim().toLowerCase()==="-c"}function wl(e,t){if(Cl(e)&&/^\s*protocol(.[a-z]+)?.allow/.test(t))throw new St(void 0,"unsafe","Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol")}function kl(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 Ol({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||wl(s,o),t||kl(s,n.method)}),r}}}O();function Tl(e){let t=te(e,"-c");return{type:"spawn.args",action(r){return[...t,...r]}}}O();var gs=(0,Ut.deferred)().promise;function xl({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 Sl="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 Al(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",Sl);if(e.some(Al))if(t)console.warn(_s);else throw new St(void 0,"binary",_s);let[n,s]=e;return{binary:n,prefix:s}}function El(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 $l(e){return!!(e.exitCode&&e.stdErr.length)}function Rl(e){return Buffer.concat([...e.stdOut,...e.stdErr])}function Fl(e=!1,t=$l,r=Rl){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 Pl=class{constructor(){this.plugins=new Set,this.events=new Ml}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 Dl(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:Il(l[1]),progress:L(l[2]),processed:L(l[3]),total:L(l[4])})}))}}]}function Il(e){return String(e.toLowerCase().split(" ",1))||"unknown"}O();function Ll(e){let t=Rs(e,["uid","gid"]);return{type:"spawn.options",action(r){return gt(gt({},t),r)}}}function jl({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 Nl(){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 Hl=bl();function Bl(e,t){var r;let n=new Pl,s=Ds(e&&(typeof e=="string"?{baseDir:e}:e)||{},t);if(!Hr(s.baseDir))throw new yl(s,"Cannot use simple-git on a directory that does not exist");return Array.isArray(s.config)&&n.add(Tl(s.config)),n.add(Ol(s.unsafe)),n.add(Nl()),n.add(xl(s.completion)),s.abort&&n.add(vl(s.abort)),s.progress&&n.add(Dl(s.progress)),s.timeout&&n.add(jl(s.timeout)),s.spawnOptions&&n.add(Ll(s.spawnOptions)),n.add(ys(Fl(!0))),s.errors&&n.add(ys(s.errors)),El(n,s.binary,(r=s.unsafe)==null?void 0:r.allowUnsafeCustomBinary),new Hl(s,n)}Yt();var Co=Bl;var ko="@lntvow/dev",Oo="4.3.5";w();var Ge=Tt(ur(),1);import ce from"fs";import Be from"path";import{fileURLToPath as Gl}from"url";var Vl=Gl(import.meta.url),Wl=Be.dirname(Vl),[To]=process.cwd().split("node_modules");console.log("process.cwd(): ",process.cwd());console.log(Ge.default.blue(`Cwd is: ${To}`));function xo(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())xo(s,i);else{if(ce.existsSync(i))return;ce.copyFileSync(s,i)}})}function So(){console.log(Ge.default.blue("Start copying template files")),xo(Be.resolve(Wl,"./configs"),To),console.log(Ge.default.green("Template files copied successfully"))}cn.default.extend(Eo.default);var Kl=Jl(import.meta.url),Ql=Yl(Kl),Zl=Ao(Ql,"../");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&&So(),r){console.log(Et.default.blue("Start init simple-git-hooks"));let s=ql("npx simple-git-hooks");console.log(s.toString())}if(n){console.log(Et.default.blue("Start init scripts"));try{let s=Ao(process.cwd(),"package.json"),i=JSON.parse(Ul(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}},zl(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(fl).filter(Boolean);t||r.sort(function(s,i){let o=s.split("."),a=i.split(".");if(o.length===1||a.length===1)return hl(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:()=>gl,addTagTask:()=>dl,tagListTask:()=>ml});function ml(e=[]){let t=e.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...e],parser(r){return yo(r,t)}}}function dl(e){return{format:"utf-8",commands:["tag",e],parser(){return{name:e}}}}function gl(e,t){return{format:"utf-8",commands:["tag","-a","-m",t,e],parser(){return{name:e}}}}var _l=d({"src/lib/tasks/tag.ts"(){"use strict";pl()}}),bl=Pa({"src/git.js"(e,t){"use strict";var{GitExecutor:r}=(vu(),H(fi)),{SimpleGitApi:n}=(bc(),H(Ui)),{Scheduler:s}=(yc(),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}=(Cc(),H(Ki)),{branchTask:I,branchLocalTask:j,deleteBranchesTask:K,deleteBranchTask:U}=(Fc(),H(ro)),{checkIgnoreTask:J}=(Dc(),H(io)),{checkIsRepoTask:mt}=(Bs(),H(js)),{cloneTask:rt,cloneMirrorTask:ht}=(jc(),H(oo)),{cleanWithOptionsTask:F,isCleanOptionsArray:E}=(Zs(),H(Ks)),{diffSummaryTask:Ht}=(sn(),H(Ti)),{fetchTask:le}=(Vc(),H(co)),{moveTask:k}=(zc(),H(ho)),{pullTask:b}=(Jc(),H(fo)),{pushTagsTask:g}=(Hi(),H(Ni)),{addRemoteTask:v,getRemotesTask:_,listRemotesTask:T,remoteTask:x,removeRemoteTask:P}=(sl(),H(mo)),{getResetMode:N,resetTask:z}=(li(),H(ai)),{stashListTask:Q}=(ol(),H(go)),{addSubModuleTask:ot,initSubModuleTask:$t,subModuleTask:wt,updateSubModuleTask:Mt}=(ll(),H(_o)),{addAnnotatedTagTask:kt,addTagTask:X,tagListTask:yt}=(_l(),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 yl=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 vl(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 Cl(e){return typeof e=="string"&&e.trim().toLowerCase()==="-c"}function wl(e,t){if(Cl(e)&&/^\s*protocol(.[a-z]+)?.allow/.test(t))throw new St(void 0,"unsafe","Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol")}function kl(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 Ol({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||wl(s,o),t||kl(s,n.method)}),r}}}O();function Tl(e){let t=te(e,"-c");return{type:"spawn.args",action(r){return[...t,...r]}}}O();var gs=(0,Ut.deferred)().promise;function xl({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 Sl="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 Al(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",Sl);if(e.some(Al))if(t)console.warn(_s);else throw new St(void 0,"binary",_s);let[n,s]=e;return{binary:n,prefix:s}}function El(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 $l(e){return!!(e.exitCode&&e.stdErr.length)}function Rl(e){return Buffer.concat([...e.stdOut,...e.stdErr])}function Fl(e=!1,t=$l,r=Rl){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 Pl=class{constructor(){this.plugins=new Set,this.events=new Ml}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 Dl(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:Il(l[1]),progress:L(l[2]),processed:L(l[3]),total:L(l[4])})}))}}]}function Il(e){return String(e.toLowerCase().split(" ",1))||"unknown"}O();function Ll(e){let t=Rs(e,["uid","gid"]);return{type:"spawn.options",action(r){return gt(gt({},t),r)}}}function jl({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 Nl(){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 Hl=bl();function Bl(e,t){var r;let n=new Pl,s=Ds(e&&(typeof e=="string"?{baseDir:e}:e)||{},t);if(!Hr(s.baseDir))throw new yl(s,"Cannot use simple-git on a directory that does not exist");return Array.isArray(s.config)&&n.add(Tl(s.config)),n.add(Ol(s.unsafe)),n.add(Nl()),n.add(xl(s.completion)),s.abort&&n.add(vl(s.abort)),s.progress&&n.add(Dl(s.progress)),s.timeout&&n.add(jl(s.timeout)),s.spawnOptions&&n.add(Ll(s.spawnOptions)),n.add(ys(Fl(!0))),s.errors&&n.add(ys(s.errors)),El(n,s.binary,(r=s.unsafe)==null?void 0:r.allowUnsafeCustomBinary),new Hl(s,n)}Yt();var Co=Bl;var ko="@lntvow/dev",Oo="4.3.6";w();var Ge=Tt(ur(),1);import ce from"fs";import Be from"path";import{fileURLToPath as Gl}from"url";var Vl=Gl(import.meta.url),Wl=Be.dirname(Vl),[To]=process.cwd().split("node_modules");console.log("process.cwd(): ",process.cwd());console.log(Ge.default.blue(`Cwd is: ${To}`));function xo(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())xo(s,i);else{if(ce.existsSync(i))return;ce.copyFileSync(s,i)}})}function So(){console.log(Ge.default.blue("Start copying template files")),xo(Be.resolve(Wl,"./configs"),To),console.log(Ge.default.green("Template files copied successfully"))}cn.default.extend(Eo.default);var Kl=Jl(import.meta.url),Ql=Yl(Kl),Zl=Ao(Ql,"../");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&&So(),r){console.log(Et.default.blue("Start init simple-git-hooks"));let s=ql("npx simple-git-hooks");console.log(s.toString())}if(n){console.log(Et.default.blue("Start init scripts"));try{let s=Ao(process.cwd(),"package.json"),i=JSON.parse(Ul(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}},zl(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 Xl()});Kt.parse();async function Xl(){let e=Co(),t=(0,cn.default)().format("YYYYMMDD");await e.cwd(Zl),await e.pull(),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.5",
3
+ "version": "4.3.6",
4
4
  "type": "module",
5
5
  "description": "开发环境依赖包",
6
6
  "keywords": [