lib/leap_cli/commands/pre.rb in leap_cli-1.5.6 vs lib/leap_cli/commands/pre.rb in leap_cli-1.6.2

- old
+ new

@@ -18,27 +18,22 @@ switch :version, :negatable => false desc 'Skip prompts and assume "yes"' switch :yes, :negatable => false - desc 'Enable debugging library (leap_cli development only)' - switch :debug, :negatable => false + desc 'Print full stack trace for exceptions and load `debugger` gem if installed.' + switch [:d, :debug], :negatable => false desc 'Disable colors in output' default_value true switch 'color', :negatable => true pre do |global,command,options,args| # # set verbosity # - LeapCli.log_level = global[:verbose].to_i - if LeapCli.log_level > 1 - ENV['GLI_DEBUG'] = "true" - else - ENV['GLI_DEBUG'] = "false" - end + LeapCli.set_log_level(global[:verbose].to_i) # # load Leapfile # unless LeapCli.leapfile.load @@ -51,36 +46,18 @@ end if !Path.platform || !File.directory?(Path.platform) bail! { log :missing, "platform directory '#{Path.platform}'" } end - if LeapCli.leapfile.platform_branch && LeapCli::Util.is_git_directory?(Path.platform) - branch = LeapCli::Util.current_git_branch(Path.platform) - if branch != LeapCli.leapfile.platform_branch - bail! "Wrong branch for #{Path.platform}. Was '#{branch}', should be '#{LeapCli.leapfile.platform_branch}'. Edit Leapfile to disable this check." - end - end - # # set log file # LeapCli.log_file = global[:log] || LeapCli.leapfile.log LeapCli::Util.log_raw(:log) { $0 + ' ' + ORIGINAL_ARGV.join(' ')} log_version LeapCli.log_in_color = global[:color] - # - # load all the nodes everything - # - manager - - # - # check requirements - # - REQUIREMENTS.each do |key| - assert_config! key - end - + true end private #