UNPKG

@ycmd/creds

Version:

LSK.js CLI Creds is the easiest way to manage GitHub / Gitlab secrets and credentials

38 lines (36 loc) 1.04 kB
import { GithubService } from './chunk-NWVSN6VI.js'; import { GitlabService } from './chunk-DWITQGH2.js'; import { loadConfig } from './chunk-REN3CD6B.js'; import { __name } from './chunk-U2DZE3DI.js'; import { Err } from '@lsk4/err'; async function createService(serviceDirname, options = {}) { const { path, config } = await loadConfig(serviceDirname); const serviceName = config.service?.serviceName; if (!serviceName) { throw new Err("!serviceName", { data: { configPath: path } }); } let service; const serviceOptions = { ...config.service, ...options, config }; if (serviceName === "github") { service = new GithubService(serviceOptions); } else if (serviceName === "gitlab") { service = new GitlabService(serviceOptions); } else { throw new Err("incorrect serviceName", { serviceName }); } return service; } __name(createService, "createService"); export { createService }; //# sourceMappingURL=out.js.map //# sourceMappingURL=chunk-ENVXYACA.js.map