Skip to content
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

Open
2 tasks done
lacymorrow opened this issue Dec 28, 2024 · 2 comments
Open
2 tasks done

[bug]: add --path is broken #6202

lacymorrow opened this issue Dec 28, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@lacymorrow
Copy link

Describe the bug

I haven't found any combination of arguments to get a custom path out of the add function

options.path ? path.resolve(cwd, options.path) : undefined

I noticed in the code that it resolves CWD, but passing that as an option as well doesn't work

const cwd = path.resolve(options.cwd)

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

Node 22, NPM 10.9.0

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues
@lacymorrow lacymorrow added the bug Something isn't working label Dec 28, 2024
@DemaPy
Copy link

DemaPy commented Dec 28, 2024

Hi, did you check this one?

Usage: shadcn add [options] [components...]

add a component to your project

Arguments:
  components         the components to add or a url to the component.

Options:
  -y, --yes          skip confirmation prompt. (default: false)
  -o, --overwrite    overwrite existing files. (default: false)
  -c, --cwd <cwd>    the working directory. defaults to the current directory.
  -a, --all          add all available components. (default: false)
  -p, --path <path>  the path to add the component to.
  -h, --help         display help for command

@lacymorrow
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants