Skip to content

Commit 8760f2a

Browse files
committed
updated chd_clean to remove additional files like tracks.
1 parent b98ca2f commit 8760f2a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

chd_clean.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,12 @@ for chd_file in *.chd; do
3535
# Get the base name of the .chd file without the extension
3636
base_name="${chd_file%.chd}"
3737

38-
# Find and delete all related files except .chd
38+
# Find and delete all related files using wildcards
3939
for ext in bin cue iso; do
40-
file="${base_name}.${ext}"
41-
if [ -f "$file" ]; then
40+
for file in "${base_name}"*."${ext}"; do
41+
# Skip if no matching files are found
42+
[ -e "$file" ] || continue
43+
4244
if [ "$approve_all" = false ]; then
4345
echo "Found: $file. Delete? [y/n/a (approve all)]"
4446
read -r response
@@ -63,7 +65,7 @@ for chd_file in *.chd; do
6365
echo "Deleting $file"
6466
rm "$file"
6567
fi
66-
fi
68+
done
6769
done
6870
done
6971

0 commit comments

Comments
 (0)