Fixes issue with same file name after paths are junked with '-j' option (e.g. Gohu) (issue #418)

This commit is contained in:
Ryan L McIntyre 2020-01-18 21:11:26 -08:00
parent e1ac5706c5
commit 2cb0488aaf

View file

@ -39,12 +39,18 @@ find -- * -maxdepth 0 -iregex "$pattern" -type d |
while read -r filename
do
basename=$(basename "$filename")
searchdir=$filename
basename=$(basename "$filename")
searchdir=$filename
[[ -d "$outputdir" ]] || mkdir -p "$outputdir"
[[ -d "$outputdir" ]] || mkdir -p "$outputdir"
# -ic (ignore case not working)
zip "$outputdir/$basename" -rj "$searchdir" -i '*.[o,t]tf' -i '*.[O,T]TF'
zip "$outputdir/$basename" -rj "$searchdir" -i '*.[o,t]tf' -i '*.[O,T]TF'
zipStatus=$?
if [ "$zipStatus" != "0" ]
then
echo "$LINE_PREFIX Could not create archive with the path junked (-j option) - likely same font names for different paths, zip status: $zipStatus"
echo "$LINE_PREFIX Retrying with full path"
zip "$outputdir/$basename" -r "$searchdir" -i '*.[o,t]tf' -i '*.[O,T]TF'
fi;
done