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