Skip to content

Commit 1e96223

Browse files
committed
feat: fix
1 parent 656320d commit 1e96223

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/commands/add.command.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Args, Command, Options } from "@effect/cli"
2-
import { Effect, Schema, pipe } from "effect"
2+
import { Console, Effect, Schema, pipe } from "effect"
33
import { REGISTRY_URL } from "~/consts"
44

55
import {
@@ -8,6 +8,7 @@ import {
88
HttpClientResponse,
99
Command as RawCommand,
1010
} from "@effect/platform"
11+
import chalk from "chalk"
1112
import { Component } from "~/schema/component"
1213

1314
export const componentNames = Args.text({ name: "componentNames" }).pipe(Args.repeated)
@@ -38,10 +39,16 @@ export const addCommand = Command.make(
3839
),
3940
)
4041

42+
if (!allComponents && componentPaths.length === 0) {
43+
yield* Console.log(chalk.red("No components selected"))
44+
yield* Console.log(chalk.red("Please select a component or use --all"))
45+
return
46+
}
47+
4148
if (allComponents) {
4249
const client = yield* HttpClient.HttpClient.pipe()
4350

44-
const response = yield* HttpClientRequest.get("http://localhost:3000/r/index.json").pipe(
51+
const response = yield* HttpClientRequest.get("https://intentui.com/r/index.json").pipe(
4552
client.execute,
4653
Effect.flatMap(HttpClientResponse.schemaBodyJson(Schema.Array(Component))),
4754
)

0 commit comments

Comments
 (0)