Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

Commit 7f6f78d

Browse files
committed
allow user to overwrite
1 parent 5233ba9 commit 7f6f78d

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@intentui/cli",
33
"type": "module",
4-
"version": "2.9.8-beta-2",
4+
"version": "2.9.8-beta-3",
55
"description": "The command line interface for Intent UI.",
66
"main": "dist/index.js",
77
"bin": {

src/commands/add.command.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,15 @@ export const addCommand = Command.make(
3737

3838
const componentPaths = yield* pipe(
3939
Effect.forEach(componentNames, (name) =>
40-
Effect.succeed(`${REGISTRY_URL}/r/${type}-${name}.json`),
40+
Effect.succeed(
41+
name.startsWith("http")
42+
? name
43+
: name.startsWith("-")
44+
? null
45+
: `${REGISTRY_URL}/r/${type}-${name}.json`
46+
),
4147
),
48+
Effect.map((list) => list.filter((url): url is string => url !== null))
4249
)
4350

4451
if (!allComponents && componentPaths.length === 0) {
@@ -59,12 +66,14 @@ export const addCommand = Command.make(
5966
componentPaths.push(...components)
6067
}
6168

62-
const args = ["add", ...componentPaths]
69+
const args = ["add"]
6370

6471
if (overwrite) {
6572
args.push("--overwrite")
6673
}
6774

75+
args.push(...componentPaths)
76+
6877
return yield* pipe(
6978
RawCommand.make("shadcnClone", ...args).pipe(
7079
RawCommand.stdin("inherit"),

0 commit comments

Comments
 (0)