Comparing version 5.2.0 to 5.3.0
@@ -151,10 +151,12 @@ #!/usr/bin/env node | ||
` | ||
Usage | ||
$ bpmnlint diagram.bpmn | ||
Usage | ||
$ bpmnlint diagram.bpmn | ||
Options | ||
Options | ||
--config, -c Path to configuration file. It overrides .bpmnlintrc if present. | ||
--init Generate a .bpmnlintrc file in the current working directory | ||
Examples | ||
$ bpmnlint ./invoice.bpmn | ||
Examples | ||
$ bpmnlint ./invoice.bpmn | ||
$ bpmnlint --init | ||
@@ -164,2 +166,5 @@ `, | ||
flags: { | ||
init: { | ||
type: 'boolean' | ||
}, | ||
config: { | ||
@@ -173,3 +178,16 @@ type: 'string', | ||
if (cli.flags.init) { | ||
if (fs.existsSync('.bpmnlintrc')) { | ||
console.warn('Not overriding existing .bpmnlintrc'); | ||
process.exit(1); | ||
} | ||
fs.writeFileSync('.bpmnlintrc', `{ | ||
"extends": "bpmnlint:recommended" | ||
}`, 'utf8'); | ||
console.error('Created .bpmnlintrc file'); | ||
process.exit(0); | ||
} | ||
if (cli.input.length === 0) { | ||
@@ -192,4 +210,4 @@ console.log('Error: bpmn file path missing.'); | ||
diagramXML = await readFile(path.resolve(diagramPath), 'utf-8'); | ||
} catch (e) { | ||
return logAndExit(`Error: Failed to read ${diagramPath}`, e); | ||
} catch (error) { | ||
return logAndExit(`Error: Failed to read ${diagramPath}\n\n%s`, error.message); | ||
} | ||
@@ -315,3 +333,3 @@ | ||
} catch (err) { | ||
return logAndExit('Error: Could not parse ' + configPath + ': ' + err.message); | ||
return logAndExit('Error: Could not parse %s\n\n%s', configPath, err.message); | ||
} | ||
@@ -318,0 +336,0 @@ |
@@ -9,2 +9,6 @@ # Changelog | ||
## 5.3.0 | ||
* `FEAT`: add `--init` option to create `.bpmnlintrc` in current working directory | ||
## 5.2.0 | ||
@@ -11,0 +15,0 @@ |
{ | ||
"name": "bpmnlint", | ||
"description": "Validate your BPMN diagrams based on configurable lint rules", | ||
"version": "5.2.0", | ||
"version": "5.3.0", | ||
"main": "lib/index.js", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41656
1273