Skip to content

Commit

Permalink
v.util: improve find_diff_cmd: don't add spaces to result without env…
Browse files Browse the repository at this point in the history
… opts (#21242)
  • Loading branch information
ttytm committed Apr 12, 2024
1 parent 739730b commit 76b85a0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vlib/v/util/diff/diff.v
Expand Up @@ -40,11 +40,11 @@ pub fn find_working_diff_command() !string {
}
}
if diffcmd in ['code', 'code.cmd'] {
// there is no guarantee that the env opts exist
// or include `-d`, so (harmlessly) add it
// Make sure the diff flag `-d` is included in any case.
return '${diffcmd} ${env_diffopts} -d'
}
return '${diffcmd} ${env_diffopts}'
// Don't add spaces to the cmd if there are no `env_diffopts`.
return if env_diffopts != '' { '${diffcmd} ${env_diffopts}' } else { diffcmd }
}
}
return error('No working "diff" command found')
Expand Down

0 comments on commit 76b85a0

Please sign in to comment.