import{n as e}from"./chunk-3THT3N7L-B1WzJUh4.mjs";import{t}from"./chunk-44UOCSGV-BZ6LfyW2.mjs";import{t as n}from"./chunk-HWKDQ44K-BJxdK4fT.mjs";var r={recursive:{short:`p`,long:`parents`,type:`boolean`},verbose:{short:`v`,long:`verbose`,type:`boolean`}},i={name:`mkdir`,async execute(i,a){let o=n(`mkdir`,i,r);if(!o.ok)return o.error;let s=o.result.flags.recursive,c=o.result.flags.verbose,l=o.result.positional;if(l.length===0)return{stdout:``,stderr:`mkdir: missing operand
`,exitCode:1};let u=``,d=``,f=0;for(let n of l)try{let e=a.fs.resolvePath(a.cwd,n);await a.fs.mkdir(e,{recursive:s}),c&&(u+=`mkdir: created directory '${n}'
`)}catch(r){let i=t(r);i.includes(`ENOENT`)||i.includes(`no such file`)?d+=`mkdir: cannot create directory '${n}': No such file or directory
`:i.includes(`EEXIST`)||i.includes(`already exists`)?d+=`mkdir: cannot create directory '${n}': File exists
`:d+=`mkdir: cannot create directory '${n}': ${e(i)}
`,f=1}return{stdout:u,stderr:d,exitCode:f}}},a={name:`mkdir`,flags:[{flag:`-p`,type:`boolean`},{flag:`-v`,type:`boolean`}],needsArgs:!0};export{a as n,i as t};
//# sourceMappingURL=chunk-MDDMCKUK-ChL1CU4m.mjs.map