UNPKG

@applicaster/zapplicaster-cli

Version:

CLI Tool for the zapp app and Quick Brick project

28 lines (22 loc) 818 B
#!/usr/bin/env node /** * Entry point for the zapplicaster-cli tool * it uses commander to expose the different actions which can be performed via the cli * Each command is declared in ./src/commands.js, and points to a dedicated function * in the ./src/command folder */ const program = require("commander"); const { forEach } = require("ramda"); const { version } = require("./package.json"); const { registerCommand, commands } = require("./src/commands"); /* iterating over commands to register them */ forEach(registerCommand(program), commands); /* pass program version and parse cli argmuents */ program .version(version) .on("command:*", function () { console.error("Invalid command: %s\n", program.args.join(" ")); program.outputHelp(); process.exit(1); }) .parse(process.argv);