Created
April 22, 2012 09:40
-
-
Save venj/2463079 to your computer and use it in GitHub Desktop.
replace aliases with soft links for command line use [ Finder treats links and aliases the same? ]
This file contains 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
#!/usr/bin/env ruby | |
require "fileutils" | |
include FileUtils | |
cd "/Users/venj" do | |
Dir["*"].each do |dir| | |
cd dir do | |
Dir["*"].each do |al| | |
path = "/Volumes/Data/#{dir}/#{al}" | |
if !File.directory?(al) && File.directory?(path) | |
rm al | |
system "ln -s \"#{path}\" \"#{al}\"" | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment