UNPKG

@wocker/ws

Version:

Docker workspace for web projects

37 lines (36 loc) 1.43 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.app = void 0; const core_1 = require("@wocker/core"); const yoctocolors_cjs_1 = __importDefault(require("yoctocolors-cjs")); const AppModule_1 = require("./AppModule"); exports.app = { async run(args) { const context = await core_1.Factory.create(AppModule_1.AppModule), appConfigService = context.get(core_1.AppConfigService), logService = context.get(core_1.LogService); try { const res = await context.run(args); if (res) { process.stdout.write(res); process.stdout.write("\n"); } } catch (err) { if (typeof err.name === "string" && ["ExitPromptError", "CancelPromptError", "AbortPromptError"].includes(err.name)) { return; } console.error(yoctocolors_cjs_1.default.red(err.message)); if (err instanceof core_1.UsageException || err.name === "UsageException") { return; } if (err instanceof core_1.CommandNotFoundError) { return; } if (appConfigService.debug) { logService.error(err.stack || err.toString()); } } } };