【代码】清理MacOS上zip文件中的隐藏目录

前言

使用Automator,编写一个清理MacOS上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