Skip to content

Commit

Permalink
feat: Updated src/index.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
sweep-ai[bot] committed Oct 16, 2023
1 parent afb95bf commit 957cb84
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,23 @@ const cSpellContent = {
writeFile(`./${projectName}.txt`, "");
writeFile("./cspell.json", JSON.stringify(cSpellContent, null, 2));

// TODO: Support other file types
const fileTypes = ["md", "ts", "json", "lua"];
// Import consola
import consola from "consola";

// Ask the user for the file types they want to check
const fileTypes = await consola.prompt("Select file types to check.", {
type: "multiselect",
options: [
{ value: "md", label: "Markdown" },
{ value: "ts", label: "TypeScript" },
{ value: "json", label: "JSON" },
{ value: "lua", label: "Lua" },
],
});

const cspellCmd = isInstalled ? "cspell" : "npx cspell";

// Run cspell on Markdown files to get unknown words
// Run cspell on the selected file types to get unknown words
const cmd = `${cspellCmd} --words-only --unique --no-progress --show-context ${fileTypes
.map((fileType) => `"**/**/*.${fileType}"`)
.join(" ")}`;
Expand Down

0 comments on commit 957cb84

Please sign in to comment.