Files

2 lines
100 KiB
JavaScript
Raw Permalink Normal View History

2025-05-09 16:55:09 +08:00
(()=>{var e={8309:(e,t,r)=>{"use strict";const s=r(2081),n=r(4605),o=r(3743);function i(e,t,r){const i=n(e,t,r),a=s.spawn(i.command,i.args,i.options);return o.hookChildProcess(a,i),a}e.exports=i,e.exports.spawn=i,e.exports.sync=function(e,t,r){const i=n(e,t,r),a=s.spawnSync(i.command,i.args,i.options);return a.error=a.error||o.verifyENOENTSync(a.status,i),a},e.exports._parse=n,e.exports._enoent=o},3743:e=>{"use strict";const t="win32"===process.platform;function r(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function s(e,s){return t&&1===e&&!s.file?r(s.original,"spawn"):null}e.exports={hookChildProcess:function(e,r){if(!t)return;const n=e.emit;e.emit=function(t,o){if("exit"===t){const t=s(o,r);if(t)return n.call(e,"error",t)}return n.apply(e,arguments)}},verifyENOENT:s,verifyENOENTSync:function(e,s){return t&&1===e&&!s.file?r(s.original,"spawnSync"):null},notFoundError:r}},4605:(e,t,r)=>{"use strict";const s=r(1017),n=r(2202),o=r(5081),i=r(7550),a="win32"===process.platform,c=/\.(?:com|exe)$/i,l=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;e.exports=function(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null);const d={command:e,args:t=t?t.slice(0):[],options:r=Object.assign({},r),file:void 0,original:{command:e,args:t}};return r.shell?d:function(e){if(!a)return e;const t=function(e){e.file=n(e);const t=e.file&&i(e.file);return t?(e.args.unshift(e.file),e.command=t,n(e)):e.file}(e),r=!c.test(t);if(e.options.forceShell||r){const r=l.test(t);e.command=s.normalize(e.command),e.command=o.command(e.command),e.args=e.args.map((e=>o.argument(e,r)));const n=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${n}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}(d)}},5081:e=>{"use strict";const t=/([()\][%!^"`<>&|;, *?])/g;e.exports.command=function(e){return e.replace(t,"^$1")},e.exports.argument=function(e,r){return e=(e=`"${e=(e=(e=`${e}`).replace(/(\\*)"/g,'$1$1\\"')).replace(/(\\*)$/,"$1$1")}"`).replace(t,"^$1"),r&&(e=e.replace(t,"^$1")),e}},7550:(e,t,r)=>{"use strict";const s=r(7147),n=r(2063);e.exports=function(e){const t=Buffer.alloc(150);let r;try{r=s.openSync(e,"r"),s.readSync(r,t,0,150,0),s.closeSync(r)}catch(e){}return n(t.toString())}},2202:(e,t,r)=>{"use strict";const s=r(1017),n=r(2806),o=r(3024);function i(e,t){const r=e.options.env||process.env,i=process.cwd(),a=null!=e.options.cwd,c=a&&void 0!==process.chdir&&!process.chdir.disabled;if(c)try{process.chdir(e.options.cwd)}catch(e){}let l;try{l=n.sync(e.command,{path:r[o({env:r})],pathExt:t?s.delimiter:void 0})}catch(e){}finally{c&&process.chdir(i)}return l&&(l=s.resolve(a?e.options.cwd:"",l)),l}e.exports=function(e){return i(e)||i(e,!0)}},8468:(e,t,r)=>{"use strict";const s=r(1017),n=r(2081),o=r(8309),i=r(8150),a=r(6147),c=r(7678),l=r(4353),d=r(3111),{spawnedKill:u,spawnedCancel:h,setupTimeout:f,validateTimeout:p,setExitHandler:m}=r(3820),{handleInput:g,getSpawnedResult:_,makeAllStream:y,validateInputSync:v}=r(4994),{mergePromise:w,getSpawnedPromise:b}=r(1708),{joinCommand:S,parseCommand:x,getEscapedCommand:E}=r(4077),k=(e,t,r={})=>{const n=o._parse(e,t,r);return e=n.command,t=n.args,(r={maxBuffer:1e8,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:(r=n.options).cwd||process.cwd(),execPath:process.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,...r}).env=(({env:e,extendEnv:t,preferLocal:r,localDir:s,execPath:n})=>{const o=t?{...process.env,...e}:e;return r?a.env({env:o,cwd:s,execPath:n}):o})(r),r.stdio=d(r),"win32"===process.platform&&"cmd"===s.basename(e,".exe")&&t.unshift("/q"),{file:e,args:t,options:r,parsed:n}},C=(e,t,r)=>"string"==typeof t||Buffer.isBuffer(t)?e.stripFinalNewline?i(t):t:void 0===r?void 0:"",O=(e,t,r)=>{const s=k(e,t,r),o=S(e,t),i=E(e,t);let a;p(s.options);try{a=n.spawn(s.file,s.args,s.options)}catch(e){const t=new n.ChildProcess,r=Promise.reject(l({error:e,stdout:"",stderr:"",all:"",command:o,escapedCommand:i,parsed:s,timedOut:!1,isCanceled:!1,killed:!1}
//# sourceMappingURL=extension.js.map