Skip to content

Instantly share code, notes, and snippets.

@vladkorotnev
Created August 14, 2013 09:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vladkorotnev/6229470 to your computer and use it in GitHub Desktop.
Save vladkorotnev/6229470 to your computer and use it in GitHub Desktop.
Shared Code Snippets for Xcode across multiple Macintoshes
First, create a folder (for example "Code snippets") in your Dropbox or whatever syncs.
Place connect_this_mac.sh into that folder.
Next, inside the folder you made and put the script into, make a folder named "stash".
Run connect_this_mac.sh. All the snippets get copied into the stash and synced.
From now on snippets will autosync. No need to restart the script.
-- vladkorotnev 2013
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$DIR"
mv ~/Library/Developer/Xcode/UserData/CodeSnippets/* stash
rm -rf ~/Library/Developer/Xcode/UserData/CodeSnippets
ln -s "$DIR/stash" ~/Library/Developer/Xcode/UserData/CodeSnippets
echo This Macintosh should now be successfully sharing the snippets with other connected Macs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment