File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 2
2
require 'optparse'
3
3
require 'fileutils'
4
4
5
- unless File . exists? ( 'formula.rb' )
5
+ formula = ARGV . find { |arg | arg =~ /\. rb$/ and File . exists? ( arg ) }
6
+ formula ||= 'formula.rb'
7
+
8
+ unless File . exists? ( formula )
6
9
STDERR . puts '*** No formula.rb found in the working directory'
7
10
exit ( 1 )
8
11
end
9
12
13
+ Dir . chdir File . dirname ( File . expand_path ( formula ) )
14
+
10
15
if ARGV . include? 'clean'
11
16
FileUtils . rm_rf %w[ tmp-build tmp-install ] , :verbose => true
12
17
exit
@@ -20,8 +25,9 @@ HOMEBREW_WORKDIR = Pathname.new(Dir.pwd)
20
25
HOMEBREW_CACHE = HOMEBREW_WORKDIR +'src'
21
26
FileUtils . mkdir_p ( HOMEBREW_CACHE )
22
27
23
- require './formula'
28
+ $:. unshift File . expand_path ( '.' )
29
+ load formula
24
30
25
- klass = File . read ( ' formula.rb' ) [ /class (\w +)/ , 1 ]
31
+ klass = File . read ( formula ) [ /class (\w +)/ , 1 ]
26
32
eval ( klass ) . package!
27
33
You can’t perform that action at this time.
0 commit comments