Formula/azure-functions-core-tools.rb (35 lines of code) (raw):

class AzureFunctionsCoreTools < Formula funcVersion = "2.7.3188" if OS.linux? funcArch = "linux-x64" funcSha = "f8cff611d0cc2198589a7ff0b1b268549bf86c11afd799098df59f7721d6b771" else funcArch = "osx-x64" funcSha = "baa850c449e9be5fcef8e2bf91883885ec9ab9471437c998701435f5164d72e5" end desc "Azure Functions Core Tools 2.0" homepage "https://docs.microsoft.com/azure/azure-functions/functions-run-local#run-azure-functions-core-tools" url "https://cdn.functions.azure.com/public/#{funcVersion}/Azure.Functions.Cli.#{funcArch}.#{funcVersion}.zip" sha256 funcSha version funcVersion head "https://github.com/Azure/azure-functions-core-tools" @@telemetry = "\n Telemetry \n --------- \n The Azure Functions Core tools collect usage data in order to help us improve your experience." \ + "\n The data is anonymous and doesn\'t include any user specific or personal information. The data is collected by Microsoft." \ + "\n \n You can opt-out of telemetry by setting the FUNCTIONS_CORE_TOOLS_TELEMETRY_OPTOUT environment variable to \'1\' or \'true\' using your favorite shell.\n" def install prefix.install Dir["*"] chmod 0555, prefix/"func" chmod 0555, prefix/"gozip" bin.install_symlink prefix/"func" begin FileUtils.touch(prefix/"telemetryDefaultOn.sentinel") print @@telemetry rescue Exception end end test do assert_match version.to_s, shell_output("#{bin}/func") system bin/"func", "new", "-l", "C#", "-t", "HttpTrigger", "-n", "confusedDevTest" assert_predicate testpath/"confusedDevTest/function.json", :exist? end end