【笔记】清理Mac下zip文件中的隐藏目录

前言

使用Automator,编写一个清理Mac下zip文件中的隐藏目录的脚本

脚本

1
2
3
4
5
6
7
8
for f in "$@"
do
fileType=$(file -bI "$f")
if [[ $fileType == "application/zip; charset=binary" ]]; then
zip -d "$f" \*__MACOSX\* || true
zip -d "$f" \*.DS_Store\* || true
fi
done

完成

参考文献

少数派——涔C