From adb580f590132c7ba02c24f3f4b81181622c1ac7 Mon Sep 17 00:00:00 2001 From: Thomas Spurden Date: Sat, 17 Aug 2019 12:08:20 +0100 Subject: [PATCH] Assume fingerprint script is in the same folder as show-dupes Allows running show-dupes from another directory --- show-dupes | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/show-dupes b/show-dupes index 0e17782..20c6b78 100755 --- a/show-dupes +++ b/show-dupes @@ -11,6 +11,8 @@ db=$1 tmpdb=$db.tmp shift +script_dir=$(dirname $0) + if test -e $tmpdb; then echo "Looks like you have a temp db left at $tmpdb" echo "If you are sure you do not want it then delete it" @@ -20,7 +22,7 @@ fi # Update the database if any paths are specified if test $# -gt 0; then { cat "$db" 2>/dev/null; find $@ -type f -printf "$placeholder %p\n"; } | \ - sort -k2 | uniq -u -s65 | grep "^$placeholder " | cut -c66- | ./fingerprint-files.py > "$tmpdb" + sort -k2 | uniq -u -s65 | grep "^$placeholder " | cut -c66- | "$script_dir/fingerprint-files.py" > "$tmpdb" if test -e "$db"; then sort -o "$db" -- "$db" "$tmpdb" || exit 1 -- 2.45.2