Created
July 22, 2012 12:39
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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