@catladder/cli
Version:
Panter cli tool for cloud CI/CD and DevOps
26 lines (25 loc) • 907 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.printVerboseBanner = void 0;
const getProjectConfig_1 = require("../../config/getProjectConfig");
const printVerboseBanner = async () => {
const config = await (0, getProjectConfig_1.getProjectConfig)();
if (!config) {
return;
}
const allCompontsWithPorts = await Promise.all(Object.keys(config.components).map(async componentName => {
const environment = await (0, getProjectConfig_1.getEnvironment)("local", componentName);
const port = environment.envVars.PORT;
if (!port) {
return null;
}
return `${componentName}: http://localhost:${port}`;
})).then(lines => lines.filter(Boolean));
const lines = ["catenv", "-------", "running on:", "", ...allCompontsWithPorts];
for (const line of lines) {
console.log(line);
}
};
exports.printVerboseBanner = printVerboseBanner;