Commit bdf3c4b
fix(cli): support --yes flag for unattended dataset import
When using `sanity dataset import` with a non-existing target dataset,
the command previously always prompted for confirmation to create it,
even when the --yes flag was provided.
This change:
- Adds -y/--yes flags to the import command's flag interface
- Auto-confirms dataset creation when --yes is provided
- Throws an error if --yes is used without specifying a target dataset
- Documents the flag in the help text
Fixes SAPP-3387
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <[email protected]>1 parent e85a815 commit bdf3c4b
File tree
2 files changed
+35
-7
lines changed- packages
- @sanity/cli/test
- sanity/src/_internal/cli/commands/dataset
2 files changed
+35
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
83 | 97 | | |
84 | 98 | | |
Lines changed: 21 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| 57 | + | |
| 58 | + | |
56 | 59 | | |
57 | 60 | | |
58 | 61 | | |
| |||
136 | 139 | | |
137 | 140 | | |
138 | 141 | | |
139 | | - | |
| 142 | + | |
| 143 | + | |
140 | 144 | | |
141 | 145 | | |
142 | 146 | | |
| |||
304 | 308 | | |
305 | 309 | | |
306 | 310 | | |
307 | | - | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
308 | 316 | | |
309 | 317 | | |
310 | 318 | | |
| |||
322 | 330 | | |
323 | 331 | | |
324 | 332 | | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
325 | 336 | | |
326 | 337 | | |
327 | 338 | | |
328 | 339 | | |
329 | 340 | | |
330 | 341 | | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
336 | 350 | | |
337 | 351 | | |
338 | 352 | | |
| |||
0 commit comments