Skip to content

Commit

Permalink
fix(cli): handle ts file extension (#1466)
Browse files Browse the repository at this point in the history
Co-authored-by: shadcn <[email protected]>
  • Loading branch information
c0b41 and shadcn committed Sep 19, 2023
1 parent ae84578 commit 0a42865
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/hot-comics-smell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"shadcn-ui": patch
---

fix file extension
1 change: 1 addition & 0 deletions packages/cli/src/commands/add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ export const add = new Command()

if (!config.tsx) {
filePath = filePath.replace(/\.tsx$/, ".jsx")
filePath = filePath.replace(/\.ts$/, ".js")
}

await fs.writeFile(filePath, content)
Expand Down

0 comments on commit 0a42865

Please sign in to comment.