lib/danger/commands/init.rb in danger-3.4.2 vs lib/danger/commands/init.rb in danger-3.5.0
- old
+ new
@@ -1,6 +1,7 @@
require "danger/commands/init_helpers/interviewer"
+require "danger/danger_core/dangerfile_generator"
require "danger/ci_source/local_git_repo"
require "yaml"
module Danger
class Init < Runner
@@ -51,11 +52,10 @@
ui.pause 0.6
ui.say " - [ ] Set up Danger to run on your CI.\n\n"
end
def setup_dangerfile
- dir = Danger.gem_path
- content = File.read(File.join(dir, "lib", "assets", "DangerfileTemplate"))
+ content = DangerfileGenerator.create_dangerfile(".", cork)
File.write("Dangerfile", content)
ui.header "Step 1: Creating a starter Dangerfile"
ui.say "I've set up an example Dangerfile for you in this folder.\n"
ui.pause 1