Skip to content

Commit

Permalink
analyzer: create vtmp directory for check-updates/up commands
Browse files Browse the repository at this point in the history
Signed-off-by: Laurent Cheylus <[email protected]>
  • Loading branch information
lcheylus committed Sep 19, 2024
1 parent 622b82a commit 7cf7998
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/check-updates.v
Original file line number Diff line number Diff line change
@@ -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')!
}
7 changes: 6 additions & 1 deletion src/up.v
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down

0 comments on commit 7cf7998

Please sign in to comment.