macOS 10.14.2 有什么好办法禁止 .DS_Store 生成吗

2019-01-14 08:11:31 +08:00
 KomeijiSatori

Aspesis 好像在 10.14.2 上安装不了,官方提供的 dmg 安装提示未知错误,手动编译报错提示平台不支持

修改 DSDontWriteNetworkStores 已经尝试过了, 无法完全禁止生成

5328 次点击
所在节点    Apple
14 条回复
hansnow
2019-01-14 08:38:01 +08:00
icebergSnow
2019-01-14 08:44:06 +08:00
DSDontWriteNetworkStores 是不在网络挂载的盘生成,当然是没用了了
KomeijiSatori
2019-01-14 08:45:10 +08:00
@hansnow 不知道是不是我编译的姿势不对, 还是会提示编译失败

➜ asepsis-as-v1.5.2 rake build
> xcodebuild -project Asepsis.xcodeproj -scheme build -configuration Release
note: Using new build system
note: Planning build
note: Using build description from disk
Build system information
error: The i386 architecture is deprecated. You should update your ARCHS build setting to remove the i386 architecture. (in target 'DesktopServicesPrivWrapper')

** BUILD FAILED **

Error[1]: build failed
KomeijiSatori
2019-01-14 08:49:53 +08:00
@KomeijiSatori 从 git clone 了一遍可以编译了
KomeijiSatori
2019-01-14 08:50:46 +08:00
@hansnow 从 git clone 之后再编译好像可以了
wlee1991
2019-01-14 09:12:58 +08:00
blueharvest 可团购,需要的话联系
vokins
2019-01-14 11:09:01 +08:00
禁止生成 .DS_Store 隐藏文件

https://support.apple.com/zh-cn/HT1629

defaults write com.apple.desktopservices DSDontWriteNetworkStores true


sudo find / -name ".DS_Store" -depth -exec rm {} \;
clavichord93
2019-01-14 11:18:24 +08:00
为啥要做这件事呢…
yyfearth
2019-01-14 12:46:56 +08:00
@vokins 2L 已经说了 这个只对网络盘有效 本地盘没用的
yyfearth
2019-01-14 12:50:25 +08:00
@clavichord93 打包的时候一堆 .DS_Store 文件很不干净 也浪费空间
另外 macOS 还有 ._. 文件
如果对方是 Windows 或者 Linux 看上去会很不舒服

Windows 也有 thumbs.db 和 Desktop.ini 这样的文件到处都是
TonyLiu2ca
2019-01-14 13:00:41 +08:00
除非为了传回 Mac 使用,而只与其它系统共享 /互传数据文件,这些._*和.DS_*文件的确是无用。
目前是打包的时候,清除一遍这些文件,写成脚本即可。一些打包软件可以自动排除这些文件。
clavichord93
2019-01-14 13:10:16 +08:00
@yyfearth 我用的 BetterZip,然后自带删除这些文件的脚本…把这些文件删了会影响 spotlight 的索引吧?
yyfearth
2019-01-14 14:39:18 +08:00
@clavichord93 我现在也不太管这些文件 因为打包和 git 都配置了忽略这些文件
不是影响 spotlight 主要是文件夹的图标 背景和其他 metadata
clavichord93
2019-01-14 22:44:47 +08:00
@yyfearth 嗯…所以我也懒得管…

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/526733

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX