Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix up install script downloading #124

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/up.v
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import term
import os

pub const analyzer_install_script_download_path = 'https://raw.githubusercontent.com/vlang/v-analyzer/main/install.vsh'
pub const analyzer_install_script_path = os.join_path(os.vtmp_dir(), 'v-analzyer', 'install.vsh')
pub const analyzer_install_script_path = os.join_path(os.vtmp_dir(), 'v-analyzer', 'install.vsh')

fn up_cmd(cmd cli.Command) ! {
download_install_vsh()!
Expand Down
4 changes: 4 additions & 0 deletions src/utils.v
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ pub fn successln(msg string) {
}

pub fn download_install_vsh() ! {
download_dir := os.join_path(os.vtmp_dir(), 'v-analyzer')
if !os.exists(download_dir) {
os.mkdir(download_dir) or { return error('Failed to create tmp dir: ${err}') }
}
http.download_file(analyzer_install_script_download_path, analyzer_install_script_path) or {
return error('Failed to download script: ${err}')
}
Expand Down