From fd980299a5d25cba4e2e73ee2b4a477776314b06 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 22 Apr 2019 14:24:46 +0200 Subject: [PATCH] Ignore ".d" binaries in debug build The comment in the patch should be self-explanatory. Signed-off-by: Matthias Beyer --- bin/core/imag/src/main.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bin/core/imag/src/main.rs b/bin/core/imag/src/main.rs index f866794c..590c1bbc 100644 --- a/bin/core/imag/src/main.rs +++ b/bin/core/imag/src/main.rs @@ -134,6 +134,13 @@ fn get_commands(out: &mut Stdout) -> Vec { .and_then(|s| s.splitn(2, "-").nth(1).map(String::from)) ) }) + .filter(|path| if cfg!(debug_assertions) { + // if we compile in debug mode during development, ignore everything that ends with + // ".d", as developers might use the ./target/debug/ directory directly in `$PATH`. + !path.ends_with(".d") + } else { + true + }) .collect::>() };