Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ program
.option("--version <version>", "Plugin version; value will be written to the manifest")
.option("--force-update-check", "Forces an update check", false)
.option("--no-update-check", "Disables updating schemas", true)
.option("--ignore-validation", "Bypass validation errors (not recommended)", false)
.action((path, opts) => pack({ ...opts, path }));

const configCommand = program.command("config").description("Manage the local configuration.");
Expand Down
19 changes: 15 additions & 4 deletions src/commands/pack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,15 @@ export const pack = command<PackOptions>(
});
} catch (err) {
if (err instanceof StdoutError) {
versioner.undo();
stdout.exit(1);
if (options.ignoreValidation) {
stdout.log().log(chalk.yellow("Ignore validation flag found, bypassing validation errors")).log();
} else {
versioner.undo();
stdout.exit(1);
}
} else {
throw err;
}

throw err;
}

// Check if there is already a file at the desired save location.
Expand Down Expand Up @@ -94,6 +98,7 @@ export const pack = command<PackOptions>(
force: false,
output: process.cwd(),
version: null,
ignoreValidation: false,
},
);

Expand Down Expand Up @@ -216,6 +221,12 @@ type PackOptions = ValidateOptions & {
*/
force?: boolean;

/**
* When `true`, allows for bypassing validation errors (not recommended); may result in unexpected
* behavior. Default `false`.
*/
ignoreValidation?: boolean;

/**
* Output directory where the plugin package will be written too; defaults to cwd.
*/
Expand Down
Loading