Skip to content

Instantly share code, notes, and snippets.

@fuzzy
Created May 14, 2012 04:26
Show Gist options
  • Save fuzzy/2691796 to your computer and use it in GitHub Desktop.
Save fuzzy/2691796 to your computer and use it in GitHub Desktop.
lndir.rb (targeted to cpkg)
#!/usr/bin/env ruby
require 'find'
Find.find(ARGV[0]) do |f|
c = ARGV[0].split('/').size
d = f.split('/').size
e = "#{ENV['CPKG_SESSION_DIR']}/#{f.split('/')[c...d].join('/')}"
begin File.symlink(f, e);
rescue Errno::EEXIST
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment