Skip to content

Commit 317d263

Browse files
trivikrAllanZhengYP
authored andcommitted
chore: prettify scripts (#705)
1 parent b8a8a84 commit 317d263

File tree

6 files changed

+20
-14
lines changed

6 files changed

+20
-14
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
}
6262
},
6363
"lint-staged": {
64-
"{packages,clients}/**/*.{ts,js,md,json}": [
64+
"{scripts,packages,clients}/**/*.{ts,js,md,json}": [
6565
"prettier --write",
6666
"git add"
6767
]

scripts/generate-clients/code-gen-dir.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
const { join, normalize } = require("path");
22

3-
const CODE_GEN_ROOT = normalize(
4-
join(__dirname, "..", "..", "codegen")
5-
);
3+
const CODE_GEN_ROOT = normalize(join(__dirname, "..", "..", "codegen"));
64

75
const CODE_GEN_INPUT_DIR = normalize(
86
join(__dirname, "..", "..", "codegen", "sdk-codegen", "aws-models")
@@ -25,4 +23,4 @@ module.exports = {
2523
CODE_GEN_ROOT,
2624
CODE_GEN_INPUT_DIR,
2725
CODE_GEN_OUTPUT_DIR
28-
};
26+
};

scripts/generate-clients/code-gen.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,6 @@ async function generateClients(models) {
3434
);
3535
}
3636

37-
module.exports = { generateClients };
37+
module.exports = {
38+
generateClients
39+
};

scripts/generate-clients/code-prettify.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ const prettifyCode = async () => {
1111
modelName,
1212
"typescript-codegen"
1313
);
14-
await spawnProcess(
15-
"./node_modules/.bin/prettier",
16-
["--write", `${artifactPath}/**/*.{ts,md,json}`]
17-
);
14+
await spawnProcess("./node_modules/.bin/prettier", [
15+
"--write",
16+
`${artifactPath}/**/*.{ts,md,json}`
17+
]);
1818
}
1919
};
2020

21-
module.exports = { prettifyCode };
21+
module.exports = {
22+
prettifyCode
23+
};

scripts/generate-clients/copy-to-clients.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,14 @@ async function copyToClients(clientsDir) {
5252
if (overwritablePredicate(packageSub) || !existsSync(destSubPath)) {
5353
//Overwrite the directories and files that are overwritable, or not yet exists
5454
if (lstatSync(packageSubPath).isDirectory()) ensureDirSync(destSubPath);
55-
copySync(packageSubPath, destSubPath, { overwrite: true });
55+
copySync(packageSubPath, destSubPath, {
56+
overwrite: true
57+
});
5658
}
5759
}
5860
}
5961
}
6062

61-
module.exports = { copyToClients };
63+
module.exports = {
64+
copyToClients
65+
};

scripts/generate-clients/spawn-process.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ const spawnProcess = (command, args = [], options = {}) =>
2020
}
2121
});
2222

23-
module.exports = { spawnProcess };
23+
module.exports = { spawnProcess };

0 commit comments

Comments
 (0)