Skip to content

Commit b2b7bd0

Browse files
committed
feat: search includes countries shortcode
1 parent 4d5a457 commit b2b7bd0

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

lib/cli.js

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ module.exports = async (argvs) => {
2727
).start();
2828
await fs.ensureDir(tempDir);
2929
try {
30-
const { from: nameWithVersion } = await extract(
31-
packageName + "@" + version,
32-
tempDir,
33-
{}
34-
);
35-
await fs.copy(tempDir + "/dist", targetDir);
36-
const timerDownloaded = timer.get();
30+
// const { from: nameWithVersion } = await extract(
31+
// packageName + "@" + version,
32+
// tempDir,
33+
// {}
34+
// );
35+
// await fs.copy(tempDir + "/dist", targetDir);
36+
// const timerDownloaded = timer.get();
3737
await onLoad(targetDir, version, argv);
3838
spinner.succeed(
3939
`${nameWithVersion} copied to ${targetDir} in ${timerDownloaded}. Have fun!`
@@ -68,13 +68,21 @@ const onLoad = async (targetDir, version, argv) => {
6868
if (skipPrompts) {
6969
return;
7070
}
71-
langsList.splice(1, 0, { title: "Enter custom", value: "custom" });
71+
let langListOut = langsList.map((v) => {
72+
return { title: `${v.title} (${v.value})`, value: v.value };
73+
});
74+
langListOut.splice(1, 0, { title: "Enter custom", value: "custom" });
7275
const questions = [
7376
{
7477
type: "autocomplete",
7578
name: "lang",
7679
message: "Select language",
77-
choices: langsList,
80+
choices: langListOut,
81+
suggest: async (input, choices) => {
82+
return choices.filter((v) =>
83+
v.title.toLowerCase().includes(input.toLowerCase())
84+
);
85+
},
7886
},
7987
];
8088

lib/countries.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@
529529
},
530530
{
531531
"value": "ro",
532-
"title": "Romanian, [])"
532+
"title": "Romanian"
533533
},
534534
{
535535
"value": "ru",

0 commit comments

Comments
 (0)