Skip to content

Commit

Permalink
Fixes issue with same file name after paths are junked with '-j' opti…
Browse files Browse the repository at this point in the history
…on (e.g. Gohu) (issue ryanoasis#418)
  • Loading branch information
ryanoasis committed Jan 19, 2020
1 parent e1ac570 commit 2cb0488
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions bin/scripts/archive-fonts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 2cb0488

Please sign in to comment.