1
0
Fork 0
mirror of synced 2024-10-06 04:54:52 +13:00

Adding version handling to CLI, #8335 - useful to see what version of CLI currently installed.

This commit is contained in:
mike12345567 2022-10-25 15:28:05 +01:00
parent 5e495c6b9c
commit e52db23142

View file

@ -1,6 +1,7 @@
#!/usr/bin/env node
require("./prebuilds")
require("./environment")
const json = require("../package.json")
const { getCommands } = require("./options")
const { Command } = require("commander")
const { getHelpDescription } = require("./utils")
@ -10,7 +11,7 @@ async function init() {
const program = new Command()
.addHelpCommand("help", getHelpDescription("Help with Budibase commands."))
.helpOption(false)
program.helpOption()
.version(json.version)
// add commands
for (let command of getCommands()) {
command.configure(program)