Files
plainleaf/bin/plug-compile.ts
T

35 lines
952 B
TypeScript
Executable File

import { Command } from "commander";
import { version } from "../version.ts";
import { plugCompileCommand } from "../client/plugos/plug_compile.ts";
const program = new Command();
program
.name("plug-compile")
.description("Bundle (compile) one or more plug manifests")
.version(version)
.usage("<options> <manifest paths>")
.argument("<manifestPaths...>", "One or more .plug.yaml manifest files")
.option("--debug", "Do not minify code", false)
.option("--info", "Print out size info per function", false)
.option("-w, --watch", "Watch for changes and rebuild", false)
.option(
"--dist <path>",
"Folder to put the resulting .plug.json file into",
".",
)
.action(async (manifestPaths: string[], options: any) => {
await plugCompileCommand(
{
dist: options.dist,
debug: options.debug,
info: options.info,
},
...manifestPaths,
);
});
program.parse(process.argv);