lib/jenkins/builder/cli.rb in jenkins-builder-0.2.2 vs lib/jenkins/builder/cli.rb in jenkins-builder-0.2.3
- old
+ new
@@ -61,10 +61,16 @@
def build(*jobs)
if options[:version]
puts Jenkins::Builder::VERSION
exit
end
- app = Jenkins::Builder::App.new(options)
+ if options.service.nil?
+ service = fzf(Config.new().services).first
+ exit if service.nil?
+ else
+ service = options.service
+ end
+ app = Jenkins::Builder::App.new(service, options)
if jobs.empty?
jobs = fzf(app.fetch_all_jobs)
exit if jobs.empty?
job = jobs.first