commit 251c1f0202dc9cc34ff9a234e2e6df7436bf7451 parent 87999b8ded8c62cd65b23e2f40d5ded6306b55b4 Author: rsiddharth <s@ricketyspace.net> Date: Tue, 7 Aug 2018 21:49:02 +0000 usr/local: Update bin/tball (dir_updated). Add new function dir_updated. Diffstat:
usr/local/bin/tball | | | 11 | +++++++++++ |
1 file changed, 11 insertions(+), 0 deletions(-)
diff --git a/usr/local/bin/tball b/usr/local/bin/tball @@ -72,6 +72,17 @@ file_updated() { return 0 } +dir_updated() { + local SRC=$1 + local DEST=$2 + + # Get file that was last modified in this directory. + local F=$(find $SRC -type f -exec stat -t '{}' \; \ + | sort -r -k 13 | head -n 1 | cut -d ' ' -f 1); + + return $(file_updated $F $DEST) +} + tb() { local SRC=${1/#\~/$HOME} local BDEST=${2/#\~/$HOME}