Search code examples
cakebuild

How I can download file from web in Cake?


I'd like to download protobuf archive from github releases (https://github.com/google/protobuf/releases/download/v2.6.1/protoc-2.6.1-win32.zip) during my Cake build.

I don't found the answer on Cake DSL reference page. Any suggestions?


Solution

  • HTTP / web operations are found under http://cakebuild.net/dsl/http-operations

    DownloadFile(string, ​FilePath)​ is probably what your looking for.

    Example usage:

    DownloadFile(
        "https://github.com/google/protobuf/releases/download/v2.6.1/protoc-2.6.1-win32.zip",
        "./protoc-2.6.1-win32.zip"
    );