fix(shadcn): fix --defaults options (#8081)

* fix(shadcn): fix defaults options

* chore: changeset
This commit is contained in:
shadcn
2025-08-26 15:49:43 +04:00
committed by GitHub
parent f854190b53
commit fc27ba2692
2 changed files with 11 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
---
"shadcn": patch
---
fix --defaults option

View File

@@ -138,6 +138,12 @@ export const init = new Command()
.option("--no-base-style", "do not install the base shadcn style.")
.action(async (components, opts) => {
try {
// Apply defaults when --defaults flag is set.
if (opts.defaults) {
opts.template = opts.template || "next"
opts.baseColor = opts.baseColor || "neutral"
}
const options = initOptionsSchema.parse({
cwd: path.resolve(opts.cwd),
isNewProject: false,