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
1 changed files with 2 additions and 1 deletions

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)