lib/danger/commands/local.rb in danger-0.6.0 vs lib/danger/commands/local.rb in danger-0.6.5
- old
+ new
@@ -20,24 +20,25 @@
dm = Dangerfile.new
dm.env = EnvironmentManager.new(ENV)
source = dm.env.ci_source
- unless source.repo_slug
- puts "danger local".red " failed because it only works with GitHub projects at the moment. Sorry."
+ if source.nil? or source.repo_slug.empty?
+ puts "danger local failed because it only works with GitHub projects at the moment. Sorry.".red
exit 0
end
- puts "Running your Dangerfile against this PR - https://github.com/#{source.repo_slug}/pull/#{source.pull_request_id}"
+ gh = dm.env.request_source
+ puts "Running your Dangerfile against this PR - https://#{gh.github_host}/#{source.repo_slug}/pull/#{source.pull_request_id}"
+
if verbose != true
puts "Turning on --verbose"
dm.verbose = true
end
puts ""
- gh = GitHub.new(dm.env.ci_source, ENV)
# We can use tokenless here, as it's running on someone's computer
# and is IP locked, as opposed to on the CI.
gh.support_tokenless_auth = true
gh.fetch_details