Comparing version 0.0.7 to 0.0.8
@@ -26,3 +26,3 @@ #!/usr/bin/env node | ||
program | ||
.version("0.0.6") | ||
.version("0.0.7") | ||
.description("Convert CRDs to OpenAPI file") | ||
@@ -34,2 +34,3 @@ .option("-i, --in <dir>", "Input directory path - required") | ||
.option("-l, --license <text>", "Module license") | ||
.option("-m, --match <text>", "match files regexp") | ||
.option("--licenseURL <text>", "Module license link") | ||
@@ -47,2 +48,6 @@ .option("--contactName <text>", "Module contact name") | ||
} | ||
let regexpMath = undefined; | ||
if (options.match) { | ||
regexpMath = new RegExp(options.match); | ||
} | ||
const licenses = { | ||
@@ -92,2 +97,6 @@ "Apache-2.0": "http://www.apache.org/licenses/", | ||
for (const file of files) { | ||
// If file don't match pattern, continue. | ||
if (regexpMath && file.match(regexpMath) === null) { | ||
continue; | ||
} | ||
const filePath = path_1.default.join(dirPath, file); | ||
@@ -94,0 +103,0 @@ const data = yield readSchema(filePath); |
{ | ||
"name": "crdtoapi", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "CustomResourceDefinitions to OpensAPI", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/yaacov/crdtoapi", |
@@ -0,1 +1,3 @@ | ||
[![npm version](https://badge.fury.io/js/crdtoapi.svg)](https://badge.fury.io/js/crdtoapi) | ||
# CustomResourceDefinitions to OpensAPI | ||
@@ -36,3 +38,7 @@ | ||
# npm i --location=global @openapitools/openapi-generator-cli | ||
openapi-generator-cli generate -g typescript-fetch --skip-validate-spec -o generated -i openapi.yaml | ||
openapi-generator-cli generate \ | ||
-g typescript-fetch \ | ||
--skip-validate-spec \ | ||
-o generated \ | ||
-i openapi.yaml | ||
``` | ||
@@ -49,2 +55,2 @@ | ||
npm publish | ||
``` | ||
``` |
@@ -20,2 +20,3 @@ #!/usr/bin/env node | ||
.option("-l, --license <text>", "Module license") | ||
.option("-m, --match <text>", "match files regexp") | ||
.option("--licenseURL <text>", "Module license link") | ||
@@ -36,2 +37,7 @@ .option("--contactName <text>", "Module contact name") | ||
let regexpMath: RegExp | undefined = undefined; | ||
if (options.match) { | ||
regexpMath = new RegExp(options.match); | ||
} | ||
type License = "Apache-2.0" | "BSD-3" | "BSD-2" | "GPL-3.0" | "GPL-2.0" | "MIT" | "MPL" | "ISC"; | ||
@@ -108,2 +114,7 @@ type Schemas = { [id: string] : Record<string, unknown>; }; | ||
for (const file of files) { | ||
// If file don't match pattern, continue. | ||
if (regexpMath && file.match(regexpMath) === null) { | ||
continue; | ||
} | ||
const filePath = path.join(dirPath, file); | ||
@@ -110,0 +121,0 @@ |
Sorry, the diff of this file is not supported yet
141941
315
55