From c91f3a3bcdebb02d187e21a89d1fa94200ce696f Mon Sep 17 00:00:00 2001 From: Aleksandar Kirilov Date: Thu, 24 Jun 2021 14:49:53 +0300 Subject: [PATCH 1/2] Add optional argument for custom path --- README.md | 5 +++++ src/sfcc-schemas.ts | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) 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/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() { From 5729e4cdf5acc64cff3fb9e2ae23109d288ae697 Mon Sep 17 00:00:00 2001 From: Aleksandar Kirilov Date: Thu, 24 Jun 2021 16:00:43 +0300 Subject: [PATCH 2/2] update version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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",