Skip to content

Commit

Permalink
fix: fix message
Browse files Browse the repository at this point in the history
  • Loading branch information
irsyadadl committed Oct 8, 2024
1 parent 5df2409 commit d614572
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/commands/add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,12 @@ async function processComponent(
fs.writeFileSync(classesFile, fileContentClasses, { flag: 'w' })
}

// Check if the component exists
if (fs.existsSync(componentPath)) {
// Only allow overriding if it's NOT a child component
if (override && !isChild) {
console.log(`${chalk.yellow('Replacing')} ${componentName}...`)
fs.rmSync(componentPath, { recursive: true, force: true })
} else if (isChild) {
console.log(`The ${chalk.blue(componentName)} ${chalk.blue('is not')} override due to the -o flag.`)
console.log(`${chalk.blue('ℹ')} ${componentName} already exists. Use the -o flag to override.`)
return
} else {
console.warn(`${chalk.blue('ℹ')} ${componentName} already exists. Use the -o flag to override.`)
Expand Down

0 comments on commit d614572

Please sign in to comment.