-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug]: add --path
is broken
#6202
Comments
Hi, did you check this one?
|
Yep! That's what I'm referring to, see the reproduction steps. I am unable to get any path to work, the cli defaults to what is in components.jaon |
This happens for me when I try to add a component to a non-existing folder path. I tried adding components via Powershell and on a Arch Linux WSL2 running bash. Both running node lts/iron (20.18.0) and npm (10.8.2). If I try to pre-create a folder and point the path argument to that it states that no package.json file was find and then it asks me if I want to start a new Next.js project there. Same happens if i try to point it to a path that end in .tsx. Either it is broken else the documentation is too scarce EDIT:
This part isn't true. I was trying to invoke the npx shadcn@latest add from the subfolder, which of course didn't work. In all cases I've tried I get the same result - it's trying to overwrite the existing component that exist in the path from the components.json file and the path argument is not respected at all. |
Describe the bug
I haven't found any combination of arguments to get a custom path out of the add function
ui/packages/cli/src/commands/add.ts
Line 127 in 1081536
I noticed in the code that it resolves CWD, but passing that as an option as well doesn't work
ui/packages/cli/src/commands/add.ts
Line 54 in 1081536
Affected component/components
CLI
How to reproduce
npx shadcn@latest add -c . --path src button
Codesandbox/StackBlitz link
No response
Logs
No response
System Info
Before submitting
The text was updated successfully, but these errors were encountered: