Skip to content

Commit

Permalink
chore: remove useless compiler_flag and copy .exe on windows (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
XiaoPangxie732 authored Jun 14, 2024
1 parent 2584e86 commit 359cc2c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions install.vsh
Original file line number Diff line number Diff line change
Expand Up @@ -340,10 +340,8 @@ fn clone_repository() ! {
fn build_from_sources() ! {
println('Building ${term.bold('v-analyzer')}...')

compiler_flag := $if windows { '-cc gcc' } $else { '' }

chdir(analyzer_sources_dir_path)!
install_deps_cmd := os.execute('v ${compiler_flag} install')
install_deps_cmd := os.execute('v install')
if install_deps_cmd.exit_code != 0 {
errorln('Failed to install dependencies for ${term.bold('v-analyzer')}')
eprintln(install_deps_cmd.output)
Expand All @@ -353,7 +351,7 @@ fn build_from_sources() ! {
println('${term.green('✓')} Dependencies for ${term.bold('v-analyzer')} installed successfully')

chdir(analyzer_sources_dir_path)!
exit_code := run_command('v ${compiler_flag} build.vsh 1>/dev/null') or {
exit_code := run_command('v build.vsh 1>/dev/null') or {
errorln('Failed to build ${term.bold('v-analyzer')}: ${err}')
return
}
Expand All @@ -369,7 +367,7 @@ fn build_from_sources() ! {
return
}

os.cp_all('${analyzer_sources_dir_path}/bin/v-analyzer', analyzer_bin_dir_path, true) or {
os.cp_all('${analyzer_sources_dir_path}/bin/v-analyzer' + $if windows { '.exe' } $else { '' }, analyzer_bin_dir_path, true) or {
println('Failed to copy ${term.bold('v-analyzer')} binary to ${analyzer_bin_dir_path}: ${err}')
return
}
Expand Down

0 comments on commit 359cc2c

Please sign in to comment.