lib/org-converge/command.rb in org-converge-0.0.3 vs lib/org-converge/command.rb in org-converge-0.0.4

- old
+ new

@@ -67,11 +67,12 @@ while not runlist_stack.empty? key, script = runlist_stack.shift with_running_engine do |engine| file = File.expand_path("#{@run_dir}/#{key}") cmd = "#{script[:lang]} #{file}" - engine.register script[:lang], cmd, { :cwd => @root_dir, :logger => logger } + display_name = script[:header][:name] || script[:lang] + engine.register display_name, cmd, { :cwd => @root_dir, :logger => logger } end end logger.info "Run has completed successfully.".green end @@ -81,10 +82,11 @@ @engine = OrgConverge::Engine.new(:logger => @logger, :babel => @babel) babel.tangle_runnable_blocks!(@run_dir) babel.ob.scripts.each do |key, script| file = File.expand_path("#{@run_dir}/#{key}") cmd = "#{script[:lang]} #{file}" - @engine.register script[:lang], cmd, { :cwd => @root_dir, :logger => logger } + display_name = script[:header][:name] || script[:lang] + @engine.register display_name, cmd, { :cwd => @root_dir, :logger => logger } end logger.info "Running code blocks now! (#{babel.ob.scripts.count} runnable blocks found in total)" @engine.start logger.info "Run has completed successfully.".green end