1
0
Fork 0
mirror of synced 2024-09-17 09:49:11 +12:00
budibase/packages/cli/src/index.ts
2023-03-02 18:21:45 +00:00

25 lines
691 B
JavaScript

#!/usr/bin/env node
import "./prebuilds"
import "./environment"
import { getCommands } from "./options"
import { Command } from "commander"
import { getHelpDescription } from "./utils"
const json = require("../package.json")
// add hosting config
async function init() {
const program = new Command()
.addHelpCommand("help", getHelpDescription("Help with Budibase commands."))
.helpOption(false)
.version(json.version)
// add commands
for (let command of getCommands()) {
command.configure(program)
}
// this will stop the program if no command found
await program.parseAsync(process.argv)
}
init().catch(err => {
console.error(`Unexpected error - `, err)
})