UNPKG

@nu-art/schema-to-types

Version:

schema-to-types - Express & Typescript based backend framework

23 lines (22 loc) 765 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getConfigArg = void 0; const schema_to_types_1 = require("./schema-to-types"); const getConfigArg = () => { const configArgPrefix = '--config='; const configArg = process.argv.find(arg => arg.startsWith(configArgPrefix)); if (!configArg) { return; } return configArg.substring(configArgPrefix.length); }; exports.getConfigArg = getConfigArg; const main = async () => { const configPath = (0, exports.getConfigArg)(); if (!configPath) { console.log("Usage: ts-node generate-types.ts --config=<config-file-path>"); process.exit(1); } await (0, schema_to_types_1.processConfig)(configPath).catch(console.error); }; main();