@zuplo/cli 1.31.0 → 1.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import fg from "fast-glob";
|
|
2
|
-
import { existsSync } from "node:fs";
|
|
2
|
+
import { existsSync, readdirSync } from "node:fs";
|
|
3
|
+
import { join } from "node:path";
|
|
3
4
|
import { simpleGit } from "simple-git";
|
|
4
5
|
import { TEST_IN_FOLDER } from "../constants.js";
|
|
5
6
|
import { CompositeValidator } from "./lib.js";
|
|
@@ -108,11 +109,16 @@ export class ZuploProjectValidator {
|
|
|
108
109
|
return { ok: true };
|
|
109
110
|
}
|
|
110
111
|
else {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
112
|
+
const files = readdirSync(join(dir, "config"));
|
|
113
|
+
const existingOASFiles = files.filter((file) => file.endsWith(".oas.json")).length >= 1;
|
|
114
|
+
if (existingOASFiles === true) {
|
|
115
|
+
return { ok: true };
|
|
116
|
+
}
|
|
115
117
|
}
|
|
118
|
+
return {
|
|
119
|
+
ok: false,
|
|
120
|
+
error: new NotAZuploProject(),
|
|
121
|
+
};
|
|
116
122
|
}
|
|
117
123
|
catch (err) {
|
|
118
124
|
return {
|