Skip to content

Commit fdec924

Browse files
committed
main: Ensure we check CWD and EXE before we proceed with anything
Signed-off-by: Daniel Silverstone <[email protected]>
1 parent 9b76817 commit fdec924

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/cli/main.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ mod topical_doc;
3131

3232
use crate::errors::*;
3333
use rustup::env_var::RUST_RECURSION_COUNT_MAX;
34+
use rustup::utils::utils;
3435

3536
use std::env;
3637
use std::path::PathBuf;
@@ -60,6 +61,11 @@ fn run_rustup_inner() -> Result<()> {
6061
// bugs in rustup.
6162
do_recursion_guard()?;
6263

64+
// Before we do anything else, ensure we know where we are and who we
65+
// are because otherwise we cannot proceed usefully.
66+
utils::current_dir()?;
67+
utils::current_exe()?;
68+
6369
// The name of arg0 determines how the program is going to behave
6470
let arg0 = match env::var("RUSTUP_FORCE_ARG0") {
6571
Ok(v) => Some(v),

0 commit comments

Comments
 (0)