import{n as e,t}from"./chunk-A5O5YHGN-DApqA6Ow.mjs";import{r as n,t as r}from"./chunk-74CEPOFO-V0JXh91S.mjs";import{t as i}from"./chunk-3ZUFRYJ4-Bv1jGN68.mjs";var a={name:`sleep`,summary:`delay for a specified amount of time`,usage:`sleep NUMBER[SUFFIX]`,description:`Pause for NUMBER seconds. SUFFIX may be:
  s - seconds (default)
  m - minutes
  h - hours
  d - days

NUMBER may be a decimal number.`,options:[`    --help display this help and exit`]},o=36e5,s={name:`sleep`,async execute(s,c){if(r(s))return n(a);if(s.length===0)return{stdout:``,stderr:`sleep: missing operand
`,exitCode:1};let l=0;for(let e of s){let t=i(e);if(t===null)return{stdout:``,stderr:`sleep: invalid time interval '${e}'
`,exitCode:1};l+=t}return l>o&&(l=o),c.signal?.aborted||(c.sleep?await c.sleep(l):c.signal?await new Promise(n=>{let r=()=>{e(i),n()},i=t(()=>{c.signal?.removeEventListener(`abort`,r),n()},l);c.signal?.addEventListener(`abort`,r,{once:!0})}):await new Promise(e=>t(e,l))),{stdout:``,stderr:``,exitCode:0}}},c={name:`sleep`,flags:[],needsArgs:!0};export{s as n,c as t};
//# sourceMappingURL=chunk-GOV5EKKI-CDGzZWfT.mjs.map