UNPKG

bruce-cli

Version:

A JS/React App automation build scaffolding with zero-configuration and out-of-the-box

1 lines 1.03 kB
var x=this&&this.__awaiter||function(t,n,e,i){return new(e||(e=Promise))((function(o,r){function s(t){try{c(i.next(t))}catch(t){r(t)}}function u(t){try{c(i.throw(t))}catch(t){r(t)}}function c(t){var n;t.done?o(t.value):(n=t.value,n instanceof e?n:new e((function(t){t(n)}))).then(s,u)}c((i=i.apply(t,n||[])).next())}))};import{readdirSync as gt,statSync as wt}from"node:fs";import{AbsPath as E,CheckPath as He}from"@yangzw/bruce-us/dist/node.js";import $t from"latest-version";import{ACTION_TEXT as m}from"../langs/index.js";import{DATA_REGEXP as Le}from"./getting.js";function Xe(){return x(this,arguments,void 0,(function*(t=[]){return yield t.reduce(((t,n)=>x(this,void 0,void 0,(function*(){const e=yield t,i=yield $t(n);return e[n]=i,e}))),Promise.resolve({}))}))}function L(t="",n="entryFile"){if(!He(t))return"";const e=gt(E(t)).filter((e=>wt(E(`${t}/${e}`)).isFile()&&Le[n].test(e)))[0]||"";return e?E(`${t}/${e}`):""}function io(t){console.log(`##### ${m[t]} #####`)}export{Xe as GetDepsVer,L as JudgeFile,io as ShowTitle};