Ignore ".d" binaries in debug build

The comment in the patch should be self-explanatory.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
Matthias Beyer 2019-04-22 14:24:46 +02:00
parent 1876220d83
commit fd980299a5
1 changed files with 7 additions and 0 deletions

View File

@ -134,6 +134,13 @@ fn get_commands(out: &mut Stdout) -> Vec<String> {
.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::<Vec<String>>()
};