Skip to content

Commit fec5307

Browse files
committed
wip
1 parent e4fc3b7 commit fec5307

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

src/bin/rustup-init.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
1414
#![recursion_limit = "1024"]
1515

16+
use std::env;
17+
1618
use anyhow::{anyhow, Context, Result};
1719
use cfg_if::cfg_if;
1820
// Public macros require availability of the internal symbols
@@ -116,9 +118,7 @@ async fn run_rustup_inner() -> Result<utils::ExitCode> {
116118

117119
// Before we do anything else, ensure we know where we are and who we
118120
// are because otherwise we cannot proceed usefully.
119-
let current_dir = process()
120-
.current_dir()
121-
.context(RustupError::LocatingWorkingDir)?;
121+
let current_dir = env::current_dir().context(RustupError::LocatingWorkingDir)?;
122122
utils::current_exe()?;
123123

124124
match process().name().as_deref() {

src/currentprocess.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,6 @@ impl Process {
106106
}
107107
}
108108

109-
pub fn current_dir(&self) -> io::Result<PathBuf> {
110-
match self {
111-
Process::OSProcess(_) => env::current_dir(),
112-
#[cfg(feature = "test")]
113-
Process::TestProcess(p) => Ok(p.cwd.clone()),
114-
}
115-
}
116-
117109
#[cfg(test)]
118110
fn id(&self) -> u64 {
119111
match self {

src/test/mock/clitools.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,18 +725,21 @@ impl Config {
725725
.into_boxed_str(),
726726
);
727727
}
728+
dbg!("create test process");
728729
let tp = currentprocess::TestProcess::new(&*self.workdir.borrow(), &arg_strings, vars, "");
729730
let mut builder = Builder::new_multi_thread();
730731
builder
731732
.enable_all()
732733
.worker_threads(2)
733734
.max_blocking_threads(2);
735+
dbg!("run test process");
734736
let process_res =
735737
currentprocess::with_runtime(tp.clone().into(), builder, rustup_mode::main(tp.cwd.clone()));
736738
// convert Err's into an ec
737739
let ec = match process_res {
738740
Ok(process_res) => process_res,
739741
Err(e) => {
742+
dbg!("handle error");
740743
currentprocess::with(tp.clone().into(), || crate::cli::common::report_error(&e));
741744
utils::ExitCode(1)
742745
}

0 commit comments

Comments
 (0)