lib/jenkins/builder/cli.rb in jenkins-builder-0.1.1 vs lib/jenkins/builder/cli.rb in jenkins-builder-0.1.2

- old
+ new

@@ -7,11 +7,11 @@ class CLI < ::Thor class << self def create_alias_commands(aliases) aliases.each do |name, command| - desc "#{name}", "alias for: #{command}" + desc "#{name}", "Alias for: `#{command}'" define_method name do |*args| self.class.start(Shellwords.split(command) + args) end end end @@ -43,11 +43,11 @@ option :silent, type: :boolean, aliases: ['-s'], desc: 'suppress console output.' option :failfast, type: :boolean, aliases: ['-f'], desc: 'stop immediately when building fails.' def build(*jobs) app = Jenkins::Builder::App.new(options) if jobs.empty? - jobs = fzf(app.all_jobs) + jobs = fzf(app.fetch_all_jobs) exit if jobs.empty? job = jobs.first if app.use_mbranch?(job) branches = fzf(app.all_branches) @@ -72,9 +72,14 @@ end desc 'unalias <ALIAS>', 'Delete alias' def unalias(name) Jenkins::Builder::App.new.delete_alias(name) + end + + desc 'refresh-jobs-cache', 'Refresh cache of job names' + def refresh_jobs_cache + Jenkins::Builder::App.new.refresh_jobs_cache end default_task :build no_commands do