diff options
| author | Adam Vandenberg | 2013-09-17 06:55:13 -0700 |
|---|---|---|
| committer | Adam Vandenberg | 2013-09-17 06:55:13 -0700 |
| commit | 907ac79606537189a0a7c822be1210c4d4801df3 (patch) | |
| tree | d76ef4403ff76c9440b446ba4297f8422bb38791 /Library/Contributions | |
| parent | e8a892068ecfe853f2f363764f228b9335d9bcab (diff) | |
| download | brew-907ac79606537189a0a7c822be1210c4d4801df3.tar.bz2 | |
make linkapps official
Diffstat (limited to 'Library/Contributions')
| -rwxr-xr-x | Library/Contributions/cmd/brew-linkapps.rb | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/Library/Contributions/cmd/brew-linkapps.rb b/Library/Contributions/cmd/brew-linkapps.rb deleted file mode 100755 index 571aedc73..000000000 --- a/Library/Contributions/cmd/brew-linkapps.rb +++ /dev/null @@ -1,31 +0,0 @@ -# Links any Applications (.app) found in installed prefixes to /Applications -require 'keg' - -TARGET_DIR = ARGV.include?("--local") ? File.expand_path("~/Applications") : "/Applications" - -unless File.exist? TARGET_DIR - opoo "#{TARGET_DIR} does not exist, stopping." - puts "Run `mkdir #{TARGET_DIR}` first." - exit 1 -end - -HOMEBREW_CELLAR.subdirs.each do |rack| - kegs = rack.subdirs.map { |d| Keg.new(d) } - next if kegs.empty? - - keg = kegs.detect(&:linked?) || kegs.max {|a,b| a.version <=> b.version} - - Dir["#{keg}/*.app", "#{keg}/bin/*.app", "#{keg}/libexec/*.app"].each do |app| - puts "Linking #{app}" - app_name = File.basename(app) - target = "#{TARGET_DIR}/#{app_name}" - - if File.exist?(target) && !File.symlink?(target) - onoe "#{target} already exists, skipping." - next - end - system "ln", "-sf", app, TARGET_DIR - end -end - -puts "Finished linking. Find the links under #{TARGET_DIR}." |
