constatic
Version:
Constatic cli
4 lines (3 loc) • 785 B
JavaScript
import{log as n,shellCommand as i,uiMessage as a}from"#helpers";async function o({command:e,distpath:l,spinner:t}){t.text=a({"en-US":"Installing dependencies...","pt-BR":"Instalando depend\xEAncias..."});const s=await i({command:e,args:["install"],cwd:l,stdio:"ignore"});switch(t.stop(),s.status){case"success":{n.success(a({"en-US":"\u2705 Dependencies installed successfully!","pt-BR":"\u2705 Depend\xEAncias instaladas com sucesso!"}));break}case"fail":case"error":{n[s.status](a({"en-US":["\u274C Unable to install dependencies!",`Install manually using ${e} install`].join(`
`),"pt-BR":["\u274C N\xE3o foi poss\xEDvel instalar depend\xEAncias!",`Instale manualmente usando ${e} install`].join(`
`)})),s.status==="error"&&n.error(s.error.message);break}}}export{o as installDeps};