Skip to content

Commit 09cb6a8

Browse files
committed
feat: lang codes
1 parent 316299f commit 09cb6a8

File tree

2 files changed

+794
-742
lines changed

2 files changed

+794
-742
lines changed

lib/cli.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ const onLoad = async (targetDir, version) => {
6969
type: "autocomplete",
7070
name: "lang",
7171
message: "Select language",
72-
choices: langs,
72+
choices: langs.map((code) => {
73+
return { title: code };
74+
}),
7375
},
7476
];
7577

@@ -79,7 +81,7 @@ const onLoad = async (targetDir, version) => {
7981
const sourceHTML = await fs.readFile(indexFile, "utf-8");
8082
const resultHTML = sourceHTML.replace(
8183
/(<html.*lang=)\"([^"]*)\"/gi,
82-
`$1"${lang}"`
84+
`$1"${lang || ""}"`
8385
);
8486
await fs.writeFile(indexFile, resultHTML);
8587
} catch (err) {

0 commit comments

Comments
 (0)