File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -158,11 +158,26 @@ export default defineCommand({
158158 for ( let i = 0 ; i < imageUrls . length ; i ++ ) {
159159 const filename = `${ prefix } _${ String ( i + 1 ) . padStart ( 3 , '0' ) } .jpg` ;
160160 const destPath = join ( outDir , filename ) ;
161+
162+ // Warn if overwriting existing file (but don't block)
163+ if ( existsSync ( destPath ) ) {
164+ process . stderr . write ( `Warning: overwriting existing file: ${ destPath } \n` ) ;
165+ }
166+
161167 await downloadFile ( imageUrls [ i ] ! , destPath , { quiet : config . quiet } ) ;
162168 saved . push ( destPath ) ;
163169 }
164170
165- if ( config . quiet ) {
171+ // --output json is respected even in --quiet mode (JSON is the actual output, not progress)
172+ if ( format === 'json' ) {
173+ console . log ( formatOutput ( {
174+ id : response . data . task_id ,
175+ saved,
176+ success_count : response . data . success_count ,
177+ failed_count : response . data . failed_count ,
178+ } , format ) ) ;
179+ } else if ( config . quiet ) {
180+ // Non-JSON quiet mode: just print file paths
166181 console . log ( saved . join ( '\n' ) ) ;
167182 } else {
168183 console . log ( formatOutput ( {
You can’t perform that action at this time.
0 commit comments