Skip to content

Instantly share code, notes, and snippets.

@idolpx
Created September 13, 2019 15:41
Show Gist options
  • Save idolpx/949f437f861b27e7d5812dc498429ad8 to your computer and use it in GitHub Desktop.
Save idolpx/949f437f861b27e7d5812dc498429ad8 to your computer and use it in GitHub Desktop.
Nintendo Switch Safe SD CARD eject on OSX
#!/bin/sh
if [ $# -lt 1 ]
then
echo "Usage: nsw_eject /path-to-mounted-sdcard/"
exit 1
fi
# Change attributes so files show up on switch
sudo chflags -R arch "$1/!install"
sudo chflags -R arch "$1/atmosphere"
sudo chflags -R arch "$1/backup"
sudo chflags -R arch "$1/bootloader"
sudo chflags -R arch "$1/config"
sudo chflags -R arch "$1/ReiNX"
sudo chflags -R arch "$1/sept"
sudo chflags -R arch "$1/switch"
# Remove unnecessary files
sudo rm -rf "$1/.fseventsd"
sudo rm -rf "$1/.Spotlight-V100"
sudo rm -rf "$1/.TemporaryItems"
sudo rm -rf "$1/.Trashes"
sudo dot_clean "$1"
# Unmount volume
diskutil unmount "$1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment