Skip to content

Commit

Permalink
install: show the installed binary file size too
Browse files Browse the repository at this point in the history
  • Loading branch information
spytheman committed Nov 13, 2024
1 parent f983d90 commit 36a875d
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions install.vsh
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ fn install_from_binary(asset ReleaseAsset, update bool) ! {
println('${term.green('✓')} ${term.bold('v-analyzer')} successfully updated to ${term.bold(asset.tag_name)}')
}

println('Path to the ${term.bold('binary')}: ${analyzer_bin_file_path}')
show_info_about_binary(analyzer_bin_file_path)

if !update {
show_hint_about_path_if_needed(analyzer_bin_file_path)
Expand Down Expand Up @@ -271,10 +271,17 @@ fn update_from_sources(update bool, nightly bool) ! {
println('${term.green('✓')} ${term.bold('v-analyzer')} successfully updated to ${updated_version}')
}

println('Path to the ${term.bold('binary')}: ${analyzer_bin_file_path}')
show_info_about_binary(analyzer_bin_file_path)
return
}

fn show_info_about_binary(analyzer_bin_file_path string) {
println('Path to the binary: ${term.bold(analyzer_bin_file_path)}')
println('Size of the binary: ${os.file_size(analyzer_bin_file_path)}')
println('Binary version:')
os.system('${os.quoted_path(analyzer_bin_file_path)} version')
}

fn get_latest_commit_hash() !string {
hash_res := os.execute('git -C ${analyzer_sources_dir_path} log -1 --format=%H')
if hash_res.exit_code != 0 {
Expand Down Expand Up @@ -319,10 +326,7 @@ fn install_from_sources(no_interaction bool) ! {
clone_repository()!
build_from_sources()!

println('Path to the binary: ${term.bold(analyzer_bin_file_path)}')
println('Binary version:')
os.system('${os.quoted_path(analyzer_bin_file_path)} version')

show_info_about_binary(analyzer_bin_file_path)
show_hint_about_path_if_needed(analyzer_bin_file_path)
}

Expand Down

0 comments on commit 36a875d

Please sign in to comment.