tools: improve diagnostic info for `v vgret -v `.

pull/13172/head
Delyan Angelov 2022-01-14 15:18:40 +02:00
parent 70aedaf184
commit 6168a4d3a2
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
1 changed files with 9 additions and 5 deletions

View File

@ -241,14 +241,18 @@ fn compare_screenshots(opt Options, output_path string, target_path string) ? {
diff_file := os.join_path(os.temp_dir(), os.file_name(src).all_before_last('.') + diff_file := os.join_path(os.temp_dir(), os.file_name(src).all_before_last('.') +
'.diff.tif') '.diff.tif')
flags := app_config.compare.flags.join(' ') flags := app_config.compare.flags.join(' ')
diff_cmd := '$idiff_exe $flags -od -o "$diff_file" -abs "$src" "$target"' diff_cmd := '$idiff_exe $flags -abs -od -o "$diff_file" -abs "$src" "$target"'
result := os.execute(diff_cmd) if opt.verbose {
if opt.verbose && result.exit_code == 0 {
eprintln('Running: $diff_cmd') eprintln('Running: $diff_cmd')
eprintln('$result.output') }
result := os.execute(diff_cmd)
if opt.verbose && result.exit_code == 0 {
eprintln('OUTPUT: \n$result.output')
} }
if result.exit_code != 0 { if result.exit_code != 0 {
eprintln('$result.output') eprintln('OUTPUT: \n$result.output')
if result.exit_code == 1 { if result.exit_code == 1 {
warns[src] = target warns[src] = target
} else { } else {