diff --git a/README.md b/README.md index e097186..bb2ea26 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,11 @@ sfcc-schemas-validate ``` Validates all the xml files in the `sites` subdirectory (following the usual cartridge folder conventions) +```bash +sfcc-schemas-validate [customPath] +``` +Optional argument to specify `customPath` + ```bash sfcc-schemas-xsdify ``` diff --git a/package.json b/package.json index b8b86a0..329c9d2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sfcc-schemas", - "version": "1.4.8", + "version": "1.4.9", "description": "Salesforce Commerce Cloud import and export schemas validator", "keywords": [ "Salesforce Commerce Cloud", diff --git a/src/sfcc-schemas.ts b/src/sfcc-schemas.ts index 43f7cfd..26b9925 100644 --- a/src/sfcc-schemas.ts +++ b/src/sfcc-schemas.ts @@ -154,7 +154,8 @@ async function validate(failsonerror) { } async function findXmlFiles() { - return glob(`${path.join(process.cwd(), 'sites')}/**/*.xml`); + const customPath = process.argv[2] || 'sites'; + return glob(`${path.join(process.cwd(), customPath)}/**/*.xml`); } function buildXsdMapping() {