Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ttytm committed Apr 11, 2024
1 parent 7f7b057 commit f6a45e9
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions cmd/tools/vpm/vcs.v
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,11 @@ const vcs_info = init_vcs_info() or {
}

fn init_vcs_info() !map[VCS]VCSInfo {
git_installed_raw_ver := os.execute_opt('git --version')!.output.all_after_last(' ').trim_space()
git_installed_ver := semver.from(git_installed_raw_ver)!
git_submod_filter_ver := semver.from('2.36.0')!
mut git_install_cmd := 'clone --depth=1 --recursive --shallow-submodules --filter=blob:none'
submod_filter_version := semver.from('2.36.0') or { panic(err) }
raw_installed_git_ver := os.execute_opt('git --version') or {
return error('failed to find git')
}.output.all_after_last(' ').trim_space()
installed_git_ver := semver.from(raw_installed_git_ver) or {
return error('failed to parse git version `${raw_installed_git_ver}`')
}
if installed_git_ver >= submod_filter_version {
if git_installed_ver >= git_submod_filter_ver {
git_install_cmd += ' --also-filter-submodules'
}
return {
Expand Down

0 comments on commit f6a45e9

Please sign in to comment.