Skip to content

Commit

Permalink
Validate Args Fix
Browse files Browse the repository at this point in the history
Looks like when I migrated the code over to the new CLI updates a little bit ago, I forgot the validation and error handling for when invalid parameters are passed in.
  • Loading branch information
Offroaders123 committed Nov 24, 2024
1 parent 1daae76 commit 5dbae0b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/bin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { readFile } from "node:fs/promises";
import { inspect } from "node:util";
import { read, write, parse, stringify, NBTData } from "../index.js";
import { readStdin, writeStdout } from "./input.js";
import { getFile, getNBT, getSNBT, getJSON, getFormat, getSpace } from "./args.js";
import { getFile, validateArgs, getNBT, getSNBT, getJSON, getFormat, getSpace } from "./args.js";

import type { RootTag } from "../index.js";

Expand All @@ -17,6 +17,7 @@ process.on("uncaughtException", error => {
});

const file = getFile(args);
validateArgs(args);
const nbt = getNBT(args);
const snbt = getSNBT(args);
const json = getJSON(args);
Expand Down

0 comments on commit 5dbae0b

Please sign in to comment.