aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMax Howell2009-10-04 19:32:02 +0100
committerMax Howell2009-10-04 20:15:33 +0100
commit346e42d4b9d1ed56fe6a3077b150d1ef6d6e5d4b (patch)
treea3e9b749b63fc8f47b6c66cb4b9d93b0e46ed0be /Library
parentef580e9541689922fb405228aaa3b95e7c5503cb (diff)
downloadbrew-346e42d4b9d1ed56fe6a3077b150d1ef6d6e5d4b.tar.bz2
Set homepage in created scripts to frontmost Safari URL
A bit of fun with Applescript, for those of us who use Safari.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/brew.h.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/Library/Homebrew/brew.h.rb b/Library/Homebrew/brew.h.rb
index 83cb79c50..4d0f45377 100644
--- a/Library/Homebrew/brew.h.rb
+++ b/Library/Homebrew/brew.h.rb
@@ -29,13 +29,15 @@ def __make url, name
path = Formula.path name
raise "#{path} already exists" if path.exist?
+ homepage = `osascript -e 'tell application "Safari" to if running then get URL of document of first window'`.chomp
+
template=<<-EOS
require 'brewkit'
class #{Formula.class_s name} <Formula
url '#{url}'
- homepage ''
md5 ''
+ homepage '#{homepage}'
cmake depends_on 'cmake'