We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 3a4f9e2 + 612e2b3 commit 7b77545Copy full SHA for 7b77545
1 file changed
src/artifact-paths.ts
@@ -2,12 +2,15 @@ import path from "path";
2
import fs from "fs";
3
4
export const getJsonFilePaths = (artifactPath: string): string[] => {
5
- const files = fs.readdirSync(artifactPath);
6
- const jsonFiles = files.filter(
7
- (filename) => filename.split(".").pop()?.toLowerCase() === "json",
8
- );
9
- const jsonPaths = jsonFiles.map((filename) =>
10
- path.join(artifactPath, filename),
11
12
- return jsonPaths;
+ let result: string[] = []
+ const files = fs.readdirSync(artifactPath)
+ files.forEach(file => {
+ const childPath = path.join(artifactPath, file)
+ if (fs.statSync(childPath).isDirectory()) {
+ result.push(...getJsonFilePaths(childPath))
+ } else if (path.extname(childPath) === ".json") {
+ result.push(childPath)
13
+ }
14
+ })
15
+ return result.sort()
16
};
0 commit comments