Skip to content

Commit

Permalink
handle empty procfile exception in cli
Browse files Browse the repository at this point in the history
  • Loading branch information
ddollar committed Apr 12, 2024
1 parent df6258d commit 1f4d44f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/foreman/cli.rb
Expand Up @@ -40,6 +40,8 @@ def start(process=nil)
engine.load_procfile(procfile)
engine.options[:formation] = "#{process}=1" if process
engine.start
rescue Foreman::Procfile::EmptyFileError
error "no processes defined"
end

desc "export FORMAT LOCATION", "Export the application to another process management format"
Expand All @@ -60,7 +62,7 @@ def export(format, location=nil)
engine.load_procfile(procfile)
formatter = Foreman::Export.formatter(format)
formatter.new(location, engine, options).export
rescue Foreman::Export::Exception => ex
rescue Foreman::Export::Exception, Foreman::Procfile::EmptyFileError => ex
error ex.message
end

Expand Down Expand Up @@ -106,6 +108,8 @@ def run(*args)
Process.wait(pid)
exit $?.exitstatus || 0
rescue Interrupt
rescue Foreman::Procfile::EmptyFileError
error "no processes defined"
end

desc "version", "Display Foreman gem version"
Expand Down

0 comments on commit 1f4d44f

Please sign in to comment.