Skip to content

Commit

Permalink
Move --compilerVersion .check next to --compilerVersion .option
Browse files Browse the repository at this point in the history
  • Loading branch information
osyrisrblx committed Oct 15, 2023
1 parent f179630 commit 6f47c85
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,14 @@ export = {
string: true,
describe: "roblox-ts compiler version",
})
.check(argv => {
if (argv.compilerVersion !== undefined && !/^\d+\.\d+\.\d+$/.test(argv.compilerVersion)) {
throw new InitError(
"Invalid --compilerVersion. You must specify a version in the form of X.X.X. (i.e. --compilerVersion 1.2.3)",
);
}
return true;
}, true)
.option("dir", {
string: true,
describe: "Project directory",
Expand Down Expand Up @@ -420,14 +428,6 @@ export = {
choices: Object.values(PackageManager),
describe: "Choose an alternative package manager",
})
.check(argv => {
if (argv.compilerVersion !== undefined && !/^\d+\.\d+\.\d+$/.test(argv.compilerVersion)) {
throw new InitError(
"Invalid --compilerVersion. You must specify a version in the form of X.X.X. (i.e. --compilerVersion 1.2.3)",
);
}
return true;
}, true)

.command([InitMode.Game, InitMode.Place], GAME_DESCRIPTION, {}, argv => init(argv as never, InitMode.Game))
.command(InitMode.Model, MODEL_DESCRIPTION, {}, argv => init(argv as never, InitMode.Model))
Expand Down

0 comments on commit 6f47c85

Please sign in to comment.