diff --git a/scripts/copy-models/index.js b/scripts/copy-models/index.js index c1378bc73840..155f51694fa4 100644 --- a/scripts/copy-models/index.js +++ b/scripts/copy-models/index.js @@ -3,7 +3,7 @@ const yargs = require("yargs"); const { promises: fsPromises } = require("fs"); const { join } = require("path"); -const { spawnProcess } = require("../generate-clients/spawn-process"); +const { spawnProcess } = require("../utils/spawn-process"); const { models } = yargs .alias("m", "models") @@ -14,6 +14,7 @@ const { models } = yargs (async () => { const OUTPUT_DIR = join(__dirname, "..", "..", "codegen", "sdk-codegen", "aws-models"); + const files = await fsPromises.readdir(models.toString(), { withFileTypes: true, }); diff --git a/scripts/generate-clients/code-gen.js b/scripts/generate-clients/code-gen.js index cdfb0a1d2ad9..2c8f09c01f65 100644 --- a/scripts/generate-clients/code-gen.js +++ b/scripts/generate-clients/code-gen.js @@ -2,7 +2,7 @@ const path = require("path"); const { emptyDirSync } = require("fs-extra"); const { copyFileSync, readdirSync, lstatSync } = require("fs"); -const { spawnProcess } = require("./spawn-process"); +const { spawnProcess } = require("../utils/spawn-process"); const { CODE_GEN_ROOT, CODE_GEN_SDK_ROOT, TEMP_CODE_GEN_INPUT_DIR } = require("./code-gen-dir"); const Glob = require("glob"); diff --git a/scripts/generate-clients/code-prettify.js b/scripts/generate-clients/code-prettify.js index 6f47e98e1de1..c3ce66d285c2 100644 --- a/scripts/generate-clients/code-prettify.js +++ b/scripts/generate-clients/code-prettify.js @@ -1,9 +1,12 @@ // @ts-check -const { spawnProcess } = require("./spawn-process"); +const { spawnProcess } = require("../utils/spawn-process"); const path = require("path"); const prettifyCode = async (dir) => { - await spawnProcess(path.join(__dirname, "..", "..", "node_modules", ".bin", "prettier"), ["--write", `${dir}/**/*.{ts,js,md,json}`]); + await spawnProcess(path.join(__dirname, "..", "..", "node_modules", ".bin", "prettier"), [ + "--write", + `${dir}/**/*.{ts,js,md,json}`, + ]); }; module.exports = { diff --git a/scripts/generate-clients/spawn-process.js b/scripts/utils/spawn-process.js similarity index 100% rename from scripts/generate-clients/spawn-process.js rename to scripts/utils/spawn-process.js