about summary refs log tree commit diff
path: root/clippy_dev
diff options
context:
space:
mode:
authorCameron Steffen <cam.steffen94@gmail.com>2021-09-08 10:55:08 -0500
committerCameron Steffen <cam.steffen94@gmail.com>2021-09-08 14:07:03 -0500
commite3b171dcf099fbb7e7d3bd2cb28b11f7d3fb2773 (patch)
tree475e6a1811e833c21909042ba7060b5f61e37b3b /clippy_dev
parent2e15c8054d7f26bf438a84a7e6a7fd34f540444f (diff)
downloadrust-e3b171dcf099fbb7e7d3bd2cb28b11f7d3fb2773.tar.gz
rust-e3b171dcf099fbb7e7d3bd2cb28b11f7d3fb2773.zip
Use relative exe paths
Diffstat (limited to 'clippy_dev')
-rw-r--r--clippy_dev/src/bless.rs13
1 files changed, 2 insertions, 11 deletions
diff --git a/clippy_dev/src/bless.rs b/clippy_dev/src/bless.rs
index c4fa0a9aca7..19153aa74d0 100644
--- a/clippy_dev/src/bless.rs
+++ b/clippy_dev/src/bless.rs
@@ -1,7 +1,6 @@
 //! `bless` updates the reference files in the repo with changed output files
 //! from the last test run.
 
-use std::env;
 use std::ffi::OsStr;
 use std::fs;
 use std::lazy::SyncLazy;
@@ -10,17 +9,9 @@ use walkdir::WalkDir;
 
 use crate::clippy_project_root;
 
-// NOTE: this is duplicated with tests/cargo/mod.rs What to do?
-pub static CARGO_TARGET_DIR: SyncLazy<PathBuf> = SyncLazy::new(|| match env::var_os("CARGO_TARGET_DIR") {
-    Some(v) => v.into(),
-    None => env::current_dir().unwrap().join("target"),
-});
-
 static CLIPPY_BUILD_TIME: SyncLazy<Option<std::time::SystemTime>> = SyncLazy::new(|| {
-    let profile = env::var("PROFILE").unwrap_or_else(|_| "debug".to_string());
-    let mut path = PathBuf::from(&**CARGO_TARGET_DIR);
-    path.push(profile);
-    path.push("cargo-clippy");
+    let mut path = std::env::current_exe().unwrap();
+    path.set_file_name("cargo-clippy");
     fs::metadata(path).ok()?.modified().ok()
 });