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

refactor: simplify path handling, remove unused utils #40

Merged
merged 2 commits into from
Mar 18, 2024
Merged
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
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.