Atom eve seo
This commit is contained in:
9
.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-A4R2GWRF.js
generated
vendored
Normal file
9
.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-A4R2GWRF.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
||||
import{a as d}from"./chunk-DLL7UR66.js";import{a as f,b as m,c}from"./chunk-QAYAQNCG.js";var g={name:"env",summary:"run a program in a modified environment",usage:"env [OPTION]... [NAME=VALUE]... [COMMAND [ARG]...]",options:["-i, --ignore-environment start with an empty environment","-u NAME, --unset=NAME remove NAME from the environment"," --help display this help and exit"]},M={name:"env",async execute(o,i){if(m(o))return f(g);let a=!1,r=[],u=new Map,t=-1;for(let n=0;n<o.length;n++){let e=o[n];if(e==="-i"||e==="--ignore-environment")a=!0;else if(e==="-u"&&n+1<o.length)r.push(o[++n]);else if(e.startsWith("-u"))r.push(e.slice(2));else if(e.startsWith("--unset="))r.push(e.slice(8));else{if(e.startsWith("--")&&e!=="--")return c("env",e);if(e.startsWith("-")&&e!=="-"){for(let l of e.slice(1))if(l!=="i"&&l!=="u")return c("env",`-${l}`);e.includes("i")&&(a=!0)}else if(e.includes("=")&&t===-1){let l=e.indexOf("="),v=e.slice(0,l),h=e.slice(l+1);u.set(v,h)}else{t=n;break}}}let s;if(a)s=new Map(u);else{s=new Map(i.env);for(let n of r)s.delete(n);for(let[n,e]of u)s.set(n,e)}if(t===-1){let n=[];for(let[e,l]of s)n.push(`${e}=${l}`);return{stdout:n.join(`
|
||||
`)+(n.length>0?`
|
||||
`:""),stderr:"",exitCode:0}}if(!i.exec)return{stdout:"",stderr:`env: command execution not supported in this context
|
||||
`,exitCode:1};let p=o.slice(t);return i.exec("command",{cwd:i.cwd,env:d(s),replaceEnv:!0,stdin:i.stdin,stdinKind:"bytes",signal:i.signal,args:p})}},y={name:"printenv",summary:"print all or part of environment",usage:"printenv [OPTION]... [VARIABLE]...",options:[" --help display this help and exit"]},N={name:"printenv",async execute(o,i){if(m(o))return f(y);let a=o.filter(t=>!t.startsWith("-"));if(a.length===0){let t=[];for(let[s,p]of i.env)t.push(`${s}=${p}`);return{stdout:t.join(`
|
||||
`)+(t.length>0?`
|
||||
`:""),stderr:"",exitCode:0}}let r=[],u=0;for(let t of a){let s=i.env.get(t);s!==void 0?r.push(s):u=1}return{stdout:r.join(`
|
||||
`)+(r.length>0?`
|
||||
`:""),stderr:"",exitCode:u}}},C={name:"env",flags:[{flag:"-i",type:"boolean"},{flag:"-u",type:"value",valueHint:"string"}]},F={name:"printenv",flags:[]};export{M as a,N as b,C as c,F as d};
|
||||
Reference in New Issue
Block a user