Created
November 10, 2011 15:24
-
-
Save lukemelia/1355108 to your computer and use it in GitHub Desktop.
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
symlinks_to_materialize.each do |symlink| | |
source = print_and_execute("readlink #{symlink}").chomp | |
source = File.expand_path(symlink + "/../" + source) | |
source_type = `file #{source} `.chomp.split(':')[1].strip().to_sym | |
print_and_execute("rm #{symlink}") | |
case source_type | |
when :directory | |
print_and_execute("cp -R #{source} #{symlink}") | |
when :file | |
print_and_execute("cp #{source} #{symlink}") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment