mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-06-11 09:51:40 +00:00
fix(shadcn): fix --defaults options (#8081)
* fix(shadcn): fix defaults options * chore: changeset
This commit is contained in:
5
.changeset/every-otters-grow.md
Normal file
5
.changeset/every-otters-grow.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"shadcn": patch
|
||||
---
|
||||
|
||||
fix --defaults option
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user