Skip to content

Commit 6988308

Browse files
committed
fix: prettify CODE_GEN_OUTPUT_DIR to improve performance (aws#708)
1 parent a882531 commit 6988308

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

scripts/generate-clients/code-prettify.js

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,11 @@
1-
const path = require("path");
2-
const { readdirSync } = require("fs");
31
const { spawnProcess } = require("./spawn-process");
42
const { CODE_GEN_OUTPUT_DIR } = require("./code-gen-dir");
53

64
const prettifyCode = async () => {
7-
for (const modelName of readdirSync(CODE_GEN_OUTPUT_DIR)) {
8-
if (modelName === "source") continue;
9-
const artifactPath = path.join(
10-
CODE_GEN_OUTPUT_DIR,
11-
modelName,
12-
"typescript-codegen"
13-
);
14-
await spawnProcess("./node_modules/.bin/prettier", [
15-
"--write",
16-
`${artifactPath}/**/*.{ts,md,json}`
17-
]);
18-
}
5+
await spawnProcess("./node_modules/.bin/prettier", [
6+
"--write",
7+
`${CODE_GEN_OUTPUT_DIR}/**/*.{ts,js,md,json}`
8+
]);
199
};
2010

2111
module.exports = {

0 commit comments

Comments
 (0)