diff --git a/packages/cli/src/commands/add.tsx b/packages/cli/src/commands/add.tsx index 205254a..a8dba7e 100644 --- a/packages/cli/src/commands/add.tsx +++ b/packages/cli/src/commands/add.tsx @@ -229,11 +229,11 @@ export default class Add extends Command { await mkdir(componentDir, {recursive: true}) } const installed = await getDirComponentInstalledFiles(componentObject, resolvedConfig) - const files = componentObject.files.filter((filename) => !installed.includes(filename)) - if (files.length === 0 && !force) { + const requiredFiles = componentObject.files.filter((filename) => !installed.includes(filename)) + if (requiredFiles.length === 0 && !force) { componentFileOra.succeed(`Component is already installed! (${componentDir})`) } else { - for await (const filename of files) { + for await (const filename of requiredFiles) { const componentFile = join(componentDir, filename) if (!existsSync(componentFile) || force) { const componentFileContentResponse = await safeFetch(