cask_pr_manual_check: fix running without an argument (#56108)

This commit is contained in:
Vítor Galvão
2018-12-13 20:59:50 +00:00
committed by GitHub
parent 81116b0779
commit a96289bf08
+1 -1
View File
@@ -6,7 +6,7 @@ require 'tmpdir'
pr_url = ARGV[0]
abort 'You need to give the script exactly one argument, the URL to a pull request from an official Homebrew Cask tap' if ARGV[0].empty?
abort 'You need to give the script exactly one argument, the URL to a pull request from an official Homebrew Cask tap' if pr_url.nil?
abort 'URL is not from an official Homebrew Cask tap' if pr_url !~ %r{^https://github.com/Homebrew/homebrew-cask.*}
pr_api = pr_url.sub(%r{^https://github.com/([^/]+)/([^/]+)/pull/([^/]+).*}, 'https://api.github.com/repos/\1/\2/pulls/\3/files')