Skip to content

Commit

Permalink
refactor: simplify path handling, remove unused utils (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
ttytm authored Mar 18, 2024
1 parent 479f42d commit 46f8097
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 29 deletions.
3 changes: 1 addition & 2 deletions config/constants.v
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module config

import os
import utils

// analyzer_name is the name of the analyzer.
pub const analyzer_name = 'v-analyzer'
Expand All @@ -11,7 +10,7 @@ pub const analyzer_config_name = 'config.toml'

// analyzer_configs_path is the path to the directory containing the
// root configuration files for the analyzer.
pub const analyzer_configs_path = utils.expand_tilde_to_home('~/.config/v-analyzer')
pub const analyzer_configs_path = os.join_path(os.home_dir(), '.config', 'v-analyzer')

// analyzer_local_configs_folder_name is the name of the directory
// containing the local configuration files for the analyzer.
Expand Down
3 changes: 1 addition & 2 deletions project/flavors/SymlinkToolchainFlavor.v
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
module flavors

import os
import utils

pub struct SymlinkToolchainFlavor {}

fn (s &SymlinkToolchainFlavor) get_home_page_candidates() []string {
symlink_path_candidates := ['/usr/local/bin/v', utils.expand_tilde_to_home('~/.local/bin/v')]
symlink_path_candidates := ['/usr/local/bin/v', '${os.home_dir()}/.local/bin/v']

mut result := []string{}

Expand Down
5 changes: 3 additions & 2 deletions src/up.v
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ module main

import cli
import term
import utils
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 = utils.expand_tilde_to_home('~/.config/v-analyzer/install.vsh')
pub const analyzer_install_script_path = os.join_path(os.home_dir(), '.config', 'v-analyzer',
'install.vsh')

fn up_cmd(cmd cli.Command) ! {
download_install_vsh()!
Expand Down
8 changes: 0 additions & 8 deletions utils/os_utils.v

This file was deleted.

5 changes: 0 additions & 5 deletions utils/os_utils_default.c.v

This file was deleted.

10 changes: 0 additions & 10 deletions utils/os_utils_windows.c.v

This file was deleted.

0 comments on commit 46f8097

Please sign in to comment.