diff options
| author | Adam Vandenberg | 2012-02-21 20:48:36 -0800 |
|---|---|---|
| committer | Adam Vandenberg | 2012-02-24 21:35:51 -0800 |
| commit | 55f3c49a9e27d88fbfecc48d982bf0f31414f9a5 (patch) | |
| tree | 0e75d93de227d87f1f83e4809fe6455ae677f090 /Library/Homebrew | |
| parent | d3f35542992c4978525b1eaaa0255c92f1e830e0 (diff) | |
| download | homebrew-55f3c49a9e27d88fbfecc48d982bf0f31414f9a5.tar.bz2 | |
Introduce block form of mkdir
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/formula.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 2ba8f5762..30c8d953b 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -123,6 +123,16 @@ class Formula def plist_name; 'homebrew.mxcl.'+name end def plist_path; prefix+(plist_name+'.plist') end + # A version of mkdir that also changes to that folder in a block + def mkdir name, &block + FileUtils.mkdir name + if block_given? + FileUtils.chdir name do + yield + end + end + end + # Use the @spec_to_use to detect the download strategy. # Can be overriden to force a custom download strategy def download_strategy |
