lib/gym/commands_generator.rb in gym-1.4.0 vs lib/gym/commands_generator.rb in gym-1.5.0

- old
+ new

@@ -4,10 +4,11 @@ HighLine.track_eof = false module Gym class CommandsGenerator include Commander::Methods + UI = FastlaneCore::UI FastlaneCore::CommanderGenerator.new.generate(Gym::Options.available_options) def self.start FastlaneCore::UpdateChecker.start_looking_for_update("gym") @@ -46,10 +47,10 @@ c.syntax = "gym init" c.description = "Creates a new Gymfile for you" c.action do |_args, options| containing = (File.directory?("fastlane") ? 'fastlane' : '.') path = File.join(containing, Gym.gymfile_name) - raise "Gymfile already exists".yellow if File.exist?(path) + UI.user_error! "Gymfile already exists" if File.exist?(path) template = File.read("#{Helper.gem_path('gym')}/lib/assets/GymfileTemplate") File.write(path, template) UI.success "Successfully created '#{path}'. Open the file using a code editor." end end