Skip to content

feat(optimize): prevent .DS_Store on network and USB volumes#692

Merged
tw93 merged 2 commits intotw93:mainfrom
sebastianbreguel:feat/optimize-prevent-network-dsstore
Apr 7, 2026
Merged

feat(optimize): prevent .DS_Store on network and USB volumes#692
tw93 merged 2 commits intotw93:mainfrom
sebastianbreguel:feat/optimize-prevent-network-dsstore

Conversation

@sebastianbreguel
Copy link
Copy Markdown
Contributor

Summary

  • Adds opt_prevent_network_dsstore optimize task that sets DSDontWriteNetworkStores and DSDontWriteUSBStores in com.apple.desktopservices
  • Stops Finder from creating .DS_Store files on SMB/AFP/NFS shares and USB volumes at the source, complementing the existing reactive clean_finder_metadata
  • Idempotent (reads current value first, reports "already enabled" when set)
  • Dry-run aware, reversible via defaults delete com.apple.desktopservices DSDontWrite{Network,USB}Stores
  • Registered in health_json.sh as safe=true

Test plan

  • bats tests/optimize.bats — all 33 tests pass (2 new)
  • Dry-run path verified
  • Idempotent path verified (reports "already enabled")
  • Manual: mo optimize runs task without error on clean macOS

@sebastianbreguel sebastianbreguel requested a review from tw93 as a code owner April 7, 2026 03:28
sebastianbreguel and others added 2 commits April 7, 2026 14:22
Add opt_prevent_network_dsstore task that sets DSDontWriteNetworkStores
and DSDontWriteUSBStores so Finder stops creating .DS_Store files on
SMB/AFP/NFS shares and USB volumes. Complements the existing reactive
clean_finder_metadata by preventing them at the source.

Idempotent, dry-run aware, reversible via defaults delete.
@tw93 tw93 force-pushed the feat/optimize-prevent-network-dsstore branch from c744afb to 0f22478 Compare April 7, 2026 06:23
@tw93 tw93 merged commit 7b69bd4 into tw93:main Apr 7, 2026
9 checks passed
@tw93
Copy link
Copy Markdown
Owner

tw93 commented Apr 7, 2026

@sebastianbreguel thanks for this. I kept the task, pushed a small maintainer follow-up to gate it behind the optional confirmation path, and merged it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants