More convert to jsx
This commit is contained in:
parent
d769e298b1
commit
0f72d048ee
8 changed files with 79 additions and 114 deletions
15
src/index.ts
15
src/index.ts
|
@ -18,12 +18,10 @@ Usage:
|
|||
|
||||
Options:
|
||||
--check Only load and check the current binding and resources, but do not compile
|
||||
--write Write the output to a file. If not specified, outputs to stdout
|
||||
--outfile Specify the output file path [default: playbill.json]
|
||||
--verbose, -v Verbose output
|
||||
--minify, -m Minify the output JSON
|
||||
--watch Watch the directory for changes and recompile
|
||||
--help, -h Show this help message
|
||||
--outfile, -o Specify the output file path. If not specified, output to stdout
|
||||
--watch, -w Watch the directory for changes and recompile
|
||||
--renderer, -r Specify the output renderer. Options: json, html
|
||||
--help, -h Show this help message
|
||||
`.trim();
|
||||
|
||||
enum ExitCode {
|
||||
|
@ -58,10 +56,9 @@ async function processBinding({ inputFilePath, options }: CLIArguments) {
|
|||
throw new CLIError(`Unknown renderer: ${options.renderer}`);
|
||||
}
|
||||
|
||||
// -- WRITE TO DISK OR STDOUT --//
|
||||
if (options.write) {
|
||||
// Write to disk if an outfile is specified
|
||||
if (options.outfile !== "") {
|
||||
await Bun.write(options.outfile, serializedPlaybill);
|
||||
|
||||
return ExitCode.Success;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue