UNPKG

@launchql/cli

Version:
32 lines (31 loc) 976 B
#!/usr/bin/env node "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.options = void 0; const fs_1 = require("fs"); const inquirerer_1 = require("inquirerer"); const path_1 = require("path"); const commands_1 = require("./commands"); if (process.argv.includes('--version') || process.argv.includes('-v')) { const pkgPath = (0, path_1.join)(__dirname, 'package.json'); const pkg = JSON.parse((0, fs_1.readFileSync)(pkgPath, 'utf8')); console.log(pkg.version); process.exit(0); } exports.options = { minimistOpts: { alias: { v: 'version', h: 'help' } } }; const app = new inquirerer_1.CLI(commands_1.commands, exports.options); app.run().then(() => { // all done! }).catch(error => { // Should not reach here with the new CLI error handling pattern // But keep as fallback for unexpected errors console.error('Unexpected error:', error); process.exit(1); });