Skip to content

Instantly share code, notes, and snippets.

@matthewbodaly
Created February 5, 2016 06:13
Show Gist options
  • Save matthewbodaly/cd666383de8bd064780e to your computer and use it in GitHub Desktop.
Save matthewbodaly/cd666383de8bd064780e to your computer and use it in GitHub Desktop.
Google Drive doesn't natively support external drives. My initial seed was on an external drive. This script / method isn't perfect as Google Drive did throw a few errors... well more than a few and I had to disconnect / reconnect a few times.
#!/bin/sh
#get current username
currentUser=$(python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "\n");')
#do thing
mkdir /Users/$currentUser/Google\ Drive
ln -s /Volumes/DataDrive/Google\ Drive/ /Users/$currentUser/Google\ Drive/
# one version of running the script this way works.... other times, ran into errors
# rm -rf /Users/$currentUser/Google\ Drive/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment