diff --git a/src/check-updates.v b/src/check-updates.v index 43acbe1..920d8a9 100644 --- a/src/check-updates.v +++ b/src/check-updates.v @@ -1,8 +1,13 @@ module main import cli +import os fn check_updates_cmd(_ cli.Command) ! { + if !os.exists(analyzer_dir) { + os.mkdir(analyzer_dir)! + } + download_install_vsh()! call_install_vsh('check-updates')! } diff --git a/src/up.v b/src/up.v index f9b6e85..fbeaf0b 100644 --- a/src/up.v +++ b/src/up.v @@ -4,10 +4,15 @@ import cli import term import os +pub const analyzer_dir = os.join_path(os.vtmp_dir(), 'v-analyzer') 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(analyzer_dir, 'install.vsh') fn up_cmd(cmd cli.Command) ! { + if !os.exists(analyzer_dir) { + os.mkdir(analyzer_dir)! + } + download_install_vsh()! is_nightly := cmd.flags.get_bool('nightly') or { false }