Skip to content

Commit

Permalink
Merge pull request #3073 from LucioFranco/lucio/home-update
Browse files Browse the repository at this point in the history
Update home usage to new env fn
  • Loading branch information
Rustin170506 authored Oct 13, 2022
2 parents b0adb0c + f784552 commit 732feb8
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
5 changes: 3 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ effective-limits = "0.5.3"
enum-map = "2.0.3"
flate2 = "1"
git-testament = "0.2"
home = {git = "https://github.com/rbtcollins/home", rev = "a243ee2fbee6022c57d56f5aa79aefe194eabe53"}
home = "0.5.4"
lazy_static = "1"
libc = "0.2"
num_cpus = "1.13"
Expand Down Expand Up @@ -127,3 +127,4 @@ lto = true
# Reduce build time by setting proc-macro crates non optimized.
[profile.release.build-override]
opt-level = 0

1 change: 1 addition & 0 deletions src/currentprocess.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use std::path::{Path, PathBuf};
use std::sync::Once;
use std::sync::{Arc, Mutex};

use home::env as home;
use rand::{thread_rng, Rng};

pub(crate) mod argsource;
Expand Down
2 changes: 2 additions & 0 deletions src/currentprocess/homethunk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ use std::io;
use std::ops::Deref;
use std::path::PathBuf;

use home::env as home;

use super::CurrentDirSource;
use super::HomeProcess;
use super::OSProcess;
Expand Down
7 changes: 4 additions & 3 deletions src/utils/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use std::io::{self, BufReader, Write};
use std::path::{Path, PathBuf};

use anyhow::{anyhow, bail, Context, Result};
use home::env as home;
use retry::delay::{jitter, Fibonacci};
use retry::{retry, OperationResult};
use sha2::Sha256;
Expand Down Expand Up @@ -493,11 +494,11 @@ pub(crate) fn to_absolute<P: AsRef<Path>>(path: P) -> Result<PathBuf> {
}

pub(crate) fn home_dir() -> Option<PathBuf> {
home::home_dir_from(&home_process())
home::home_dir_with_env(&home_process())
}

pub(crate) fn cargo_home() -> Result<PathBuf> {
home::cargo_home_from(&home_process()).context("failed to determine cargo home")
home::cargo_home_with_env(&home_process()).context("failed to determine cargo home")
}

// Creates a ~/.rustup folder
Expand All @@ -524,7 +525,7 @@ fn rustup_home_in_user_dir() -> Result<PathBuf> {
}

pub(crate) fn rustup_home() -> Result<PathBuf> {
home::rustup_home_from(&home_process()).context("failed to determine rustup home dir")
home::rustup_home_with_env(&home_process()).context("failed to determine rustup home dir")
}

pub(crate) fn format_path_for_display(path: &str) -> String {
Expand Down

0 comments on commit 732feb8

Please sign in to comment.