Updates
This commit is contained in:
28
lowcoder/client/packages/lowcoder-cli/index.js
Executable file
28
lowcoder/client/packages/lowcoder-cli/index.js
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
import("./util/log.js");
|
||||
import fs from "node:fs";
|
||||
import { Command } from "commander";
|
||||
import initAction from "./actions/init.js";
|
||||
import buildAction from "./actions/build.js";
|
||||
|
||||
const program = new Command();
|
||||
|
||||
const pkg = JSON.parse(fs.readFileSync("./package.json").toString());
|
||||
program.name(pkg.name).description(pkg.description);
|
||||
|
||||
program
|
||||
.command("init")
|
||||
.description("init project")
|
||||
.option("-t, --template", "template name", "typescript")
|
||||
.option("--registry [addr]", "npm registry")
|
||||
.action(initAction);
|
||||
|
||||
program
|
||||
.command("build")
|
||||
.description("build component lib")
|
||||
.option("--outDir", "where to place tar ball", "./")
|
||||
.option("--publish", "publish to npm", false)
|
||||
.action(buildAction);
|
||||
|
||||
program.parse();
|
||||
Reference in New Issue
Block a user