Skip to content

Commit 0a42865

Browse files
c0b41shadcn
andauthored
fix(cli): handle ts file extension (#1466)
Co-authored-by: shadcn <m@shadcn.com>
1 parent ae84578 commit 0a42865

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

.changeset/hot-comics-smell.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"shadcn-ui": patch
3+
---
4+
5+
fix file extension

packages/cli/src/commands/add.ts

+1
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ export const add = new Command()
155155

156156
if (!config.tsx) {
157157
filePath = filePath.replace(/\.tsx$/, ".jsx")
158+
filePath = filePath.replace(/\.ts$/, ".js")
158159
}
159160

160161
await fs.writeFile(filePath, content)

0 commit comments

Comments
 (0)