Skip to content

Commit

Permalink
feat: add warning for command (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
shadcn authored Mar 8, 2023
1 parent becbafc commit 712e625
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/witty-apples-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@shadcn/ui": patch
---

add warning for command
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
"build": "turbo run build",
"build:cli": "turbo --filter=@shadcn/ui build",
"dev": "turbo run dev --parallel",
"dev:cli": "turbo --filter=@shadcn/ui dev",
"start:cli": "pnpm --filter=@shadcn/ui start:dev",
"lint": "turbo run lint",
"preview": "turbo run preview",
"typecheck": "turbo run typecheck",
Expand Down
8 changes: 8 additions & 0 deletions packages/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ async function main() {
.command("add")
.description("add components to your project")
.action(async () => {
logger.warn(
"Running the following command will overwrite existing files."
)
logger.warn(
"Make sure you have committed your changes before proceeding."
)
logger.warn("")

const { components, dir } = await promptForAddOptions()
if (!components?.length) {
logger.warn("No components selected. Nothing to install.")
Expand Down

0 comments on commit 712e625

Please sign in to comment.