From 359cc2cc08a536f845b10c4ff55850ea1eece0f9 Mon Sep 17 00:00:00 2001 From: XiaoPangxie732 <47449269+XiaoPangxie732@users.noreply.github.com> Date: Sat, 15 Jun 2024 04:38:58 +0800 Subject: [PATCH] chore: remove useless `compiler_flag` and copy `.exe` on windows (#108) --- install.vsh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/install.vsh b/install.vsh index 56adb332..6344106a 100644 --- a/install.vsh +++ b/install.vsh @@ -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) @@ -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 } @@ -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 }