From f5d56602df70950de6b7d40966b00c9939c81763 Mon Sep 17 00:00:00 2001 From: Robert Günzler Date: Sun, 26 Jan 2020 17:16:07 +0100 Subject: Intial commit of v2 See https://drewdevault.com/2019/12/30/dotfiles.html --- bin/find-rust-target-dir | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 bin/find-rust-target-dir (limited to 'bin/find-rust-target-dir') diff --git a/bin/find-rust-target-dir b/bin/find-rust-target-dir new file mode 100755 index 0000000..b59a2b4 --- /dev/null +++ b/bin/find-rust-target-dir @@ -0,0 +1,16 @@ +#!/bin/bash + +is_rust_root() { + [ -f $1/Cargo.toml ] || return 1 + [ -d $1/target ] || return 1 + return 0 +} + +inspect() { + for dir in `fd -t d -d 1 '' "${1}"`; do + is_rust_root ${dir} && { echo ${dir}; du -h -d 0; echo -e "\n"; continue; } + inspect ${dir} + done +} + +inspect ${1:-$PWD} -- cgit 1.4.1