Skip to content

Instantly share code, notes, and snippets.

@BenConstable
Created July 22, 2012 12:39
Show Gist options
  • Save BenConstable/3159538 to your computer and use it in GitHub Desktop.
Save BenConstable/3159538 to your computer and use it in GitHub Desktop.
Simple script to link dotfiles stored in Dropbox to the local home directory
# Link dotfiles
dropboxPath = File.expand_path(File.dirname(__FILE__))
targetPath = File.expand_path('~')
files = 0
Dir.foreach(dropboxPath) do |file|
if (file != '.') && (file != '..') && (file != File.basename(__FILE__))
%x[ln -sF #{dropboxPath}/#{file} #{targetPath}/#{file}]
files += 1
end
end
puts "Linked #{files} file(s)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment