@the-grove/cli 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +15 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -43,7 +43,9 @@ async function add(components, options) {
|
|
|
43
43
|
}
|
|
44
44
|
spinner.start(`Adding ${componentName}...`);
|
|
45
45
|
}
|
|
46
|
-
spinner.
|
|
46
|
+
spinner.stop();
|
|
47
|
+
console.log(chalk.gray(`Installing ${componentName} via shadcn...
|
|
48
|
+
`));
|
|
47
49
|
const args = ["shadcn@latest", "add", registryUrl];
|
|
48
50
|
if (options.yes) {
|
|
49
51
|
args.push("--yes");
|
|
@@ -51,13 +53,21 @@ async function add(components, options) {
|
|
|
51
53
|
if (options.path) {
|
|
52
54
|
args.push("--path", options.path);
|
|
53
55
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
+
try {
|
|
57
|
+
await execa("npx", args, { stdio: "inherit" });
|
|
58
|
+
console.log(chalk.green(`\u2713 Added ${componentName}`));
|
|
59
|
+
} catch (error) {
|
|
60
|
+
console.log(chalk.red(`\u2717 Failed to add ${componentName}`));
|
|
61
|
+
throw error;
|
|
62
|
+
}
|
|
56
63
|
}
|
|
57
64
|
console.log(chalk.green("\n\u2705 All components added successfully!"));
|
|
58
65
|
} catch (error) {
|
|
59
|
-
spinner.
|
|
60
|
-
console.error(chalk.red(
|
|
66
|
+
spinner.stop();
|
|
67
|
+
console.error(chalk.red("\n\u2717 Failed to add component"));
|
|
68
|
+
if (error instanceof Error && error.message) {
|
|
69
|
+
console.error(chalk.red(error.message));
|
|
70
|
+
}
|
|
61
71
|
process.exit(1);
|
|
62
72
|
}
|
|
63
73
|
}
|