@ycmd/commands
Version:
LSK.js CLI Creds is the easiest way to manage GitHub / Gitlab secrets and credentials
7 lines (5 loc) • 1.07 kB
JavaScript
import { createCommand, shellParallel, shell, isFileExist, getShortPath } from 'ycmd';
var P=createCommand({command:"build:gitlab-ci",describe:"generate GitLab CI configurations",async main({isRoot:r,log:s,ctx:o,cwd:e,config:p}){r&&(await shellParallel("ycmd build:gitlab-ci",{ctx:o}),await shell("ycmd build:gitlab-ci",{ctx:o,cwd:`${e}/apps`}),await shell("ycmd build:gitlab-ci",{ctx:o,cwd:`${e}/libs`}));let{getComment:g,jsonToFile:$}=await import('@lsk4/stringify'),{rootRepo:b,packages:u,rootPath:a}=p,l=e.replace(`${a}/`,"").replace(a,""),i=l.split("/").reverse()[0];(i==="packages"||i==="apps"||e===a)&&(i=null);let t=`${l}/.gitlab-ci.js`,n=`${l}/.gitlab-ci.yml`;if(!await isFileExist(`${a}/${t}`)){s.trace("[skip]",getShortPath(t));return}let d=(await import(`${a}/${t}`)).default,f=d({packages:i?[{name:i,path:l}]:u});s.trace("[save]",` ${getShortPath(t)} => ${getShortPath(n)}`),await $(`${a}/${n}`,f,{format:"yml",comment:g({name:t,url:`${b}/${t}`})});}});
export { P as default };
//# sourceMappingURL=out.js.map
//# sourceMappingURL=build-gitlab-ci.js.map