Skip to content

Instantly share code, notes, and snippets.

@smoofra
Last active August 29, 2015 14:25
Show Gist options
  • Save smoofra/961808ddb8ae0b67188a to your computer and use it in GitHub Desktop.
Save smoofra/961808ddb8ae0b67188a to your computer and use it in GitHub Desktop.
Homebrew formula snippet to grab source from a local directory
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