summaryrefslogtreecommitdiffstats
path: root/bin/core
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2019-04-22 14:24:46 +0200
committerMatthias Beyer <mail@beyermatthias.de>2019-04-22 14:24:46 +0200
commitfd980299a5d25cba4e2e73ee2b4a477776314b06 (patch)
treef649284d2f339d8c30cd831cfd5afb7be634f395 /bin/core
parent1876220d83492b1e3dde2f36e19ef96dd6d16400 (diff)
Ignore ".d" binaries in debug build
The comment in the patch should be self-explanatory. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'bin/core')
-rw-r--r--bin/core/imag/src/main.rs7
1 files changed, 7 insertions, 0 deletions
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<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>>()
};