mirror of
https://github.com/chenasraf/schemastore.git
synced 2026-05-17 17:58:02 +00:00
build: Allow specifying a single file to validate (#2369)
This commit is contained in:
@@ -56,7 +56,7 @@ To make sure that files are validated against your schema correctly (we strongly
|
||||
|
||||
1. Create a subfolder in [`src/test`](src/test) named as your schema file
|
||||
2. Create one or more `.json, .yml or .yaml` files in that folder
|
||||
3. Run `npm run build`
|
||||
3. Run `npm run build` (to test a single schema, use `npm run build -- --SchemaName=<jsonFileName.json> default`)
|
||||
|
||||
If the build succeeds, your changes are valid and you can safely create a PR.
|
||||
|
||||
|
||||
@@ -119,6 +119,11 @@ module.exports = function (grunt) {
|
||||
skipReadFile = true,
|
||||
processOnlyThisOneSchemaFile = undefined
|
||||
} = {}) {
|
||||
const schemaNameOption = grunt.option('SchemaName')
|
||||
if (processOnlyThisOneSchemaFile === undefined && schemaNameOption) {
|
||||
processOnlyThisOneSchemaFile = schemaNameOption
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Check if the present json schema file must be tested or not
|
||||
* @param {string} jsonFilename
|
||||
|
||||
Reference in New Issue
Block a user