From 1902b9606a0b942fdcd9e9b003633a156ccb5c59 Mon Sep 17 00:00:00 2001 From: p-sw Date: Sat, 15 Jun 2024 03:01:48 +0900 Subject: [PATCH] refactor(cli): rename files to requiredFiles of component --- packages/cli/src/commands/add.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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(