Last active
August 29, 2015 14:25
-
-
Save smoofra/961808ddb8ae0b67188a to your computer and use it in GitHub Desktop.
Homebrew formula snippet to grab source from a local directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LocalDirectoryDownloadStrategy < AbstractDownloadStrategy | |
def initialize(name, resource) | |
super | |
@url = @url.sub(%r[^file://], "") | |
end | |
def stage | |
ohai "cp -r #{@url}/* ." | |
cp_r(Dir[@url + "/*"], ".") | |
end | |
end | |
class <<nil | |
def file? | |
return false | |
end | |
end | |
# url "file:///some/directory", :using => LocalDirectoryDownloadStrategy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment