@launchql/cli
Version:
LaunchQL CLI
38 lines (32 loc) • 1.21 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("@launchql/core");
const installUsageText = `
LaunchQL Install Command:
lql install <package>...
Install LaunchQL modules into current module.
Arguments:
package One or more package names to install
Options:
--help, -h Show this help message
--cwd <directory> Working directory (default: current directory)
Examples:
lql install @launchql/base32 Install single package
lql install @launchql/base32 @launchql/utils Install multiple packages
`;
exports.default = async (argv, prompter, _options) => {
// Show usage if explicitly requested
if (argv.help || argv.h) {
console.log(installUsageText);
process.exit(0);
}
const { cwd = process.cwd() } = argv;
const project = new core_1.LaunchQLPackage(cwd);
if (!project.isInModule()) {
throw new Error('You must run this command inside a LaunchQL module.');
}
if (argv._.length === 0) {
throw new Error('You must provide a package name to install, e.g. `@launchql/base32`');
}
await project.installModules(...argv._);
};
;