Commit 2ea8954
feat: Include Confirmation dialogue if a file is about to be overwritten
- Added in a `huh.NewConfirm` and `huh.NewInput` fields, that checks
if the output file already exists within the given directory
- If the user selects to `overwrite` the file, execution continues as is
- If the user selects to `not overwrite` the file, an `input` field is
provided to select a new output filename
- The `huh` forms will be rendered only if the `stdout` is a terminal1 parent 7608512 commit 2ea8954
1 file changed
+40
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
134 | 135 | | |
135 | 136 | | |
136 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
137 | 177 | | |
138 | 178 | | |
139 | 179 | | |
| |||
393 | 433 | | |
394 | 434 | | |
395 | 435 | | |
396 | | - | |
397 | | - | |
398 | 436 | | |
399 | 437 | | |
400 | 438 | | |
| |||
0 commit comments