33 lines
720 B
JavaScript
33 lines
720 B
JavaScript
#!/usr/bin/env bun
|
|
import { program } from "commander";
|
|
import start from "./start";
|
|
import dev from "./dev";
|
|
import build from "./build";
|
|
import { log } from "../utils/log";
|
|
/**
|
|
* # Describe Program
|
|
*/
|
|
program
|
|
.name(`bunext`)
|
|
.description(`A React Next JS replacement built with bun JS`)
|
|
.version(`1.0.0`);
|
|
/**
|
|
* # Declare Commands
|
|
*/
|
|
program.addCommand(dev());
|
|
program.addCommand(start());
|
|
program.addCommand(build());
|
|
/**
|
|
* # Handle Unavailable Commands
|
|
*/
|
|
program.on("command:*", () => {
|
|
log.error("Invalid command: %s\nSee --help for a list of available commands." +
|
|
" " +
|
|
program.args.join(" "));
|
|
process.exit(1);
|
|
});
|
|
/**
|
|
* # Parse Arguments
|
|
*/
|
|
program.parse(Bun.argv);
|