lib/licensed/commands/command.rb in licensed-2.0.0 vs lib/licensed/commands/command.rb in licensed-2.0.1

- old
+ new

@@ -18,11 +18,13 @@ # Returns whether the command was a success def run(**options) @options = options begin result = reporter.report_run(self) do - config.apps.map { |app| run_app(app) }.all? + config.apps.sort_by { |app| app["name"] } + .map { |app| run_app(app) } + .all? end ensure @options = nil end @@ -39,11 +41,13 @@ # Returns whether the command succeeded for the application. def run_app(app) reporter.report_app(app) do |report| Dir.chdir app.source_path do begin - app.sources.select(&:enabled?).map { |source| run_source(app, source) }.all? + app.sources.select(&:enabled?) + .sort_by { |source| source.class.type } + .map { |source| run_source(app, source) }.all? rescue Licensed::Shell::Error => err report.errors << err.message false end end @@ -58,10 +62,12 @@ # # Returns whether the command succeeded for the dependency source enumerator def run_source(app, source) reporter.report_source(source) do |report| begin - source.dependencies.map { |dependency| run_dependency(app, source, dependency) }.all? + source.dependencies.sort_by { |dependency| dependency.name } + .map { |dependency| run_dependency(app, source, dependency) } + .all? rescue Licensed::Shell::Error => err report.errors << err.message false rescue Licensed::Sources::Source::Error => err report.errors << err.message