Commit 980079e
Changed files (2)
lib
elelem
plugins
lib/elelem/plugins/execute.rb
@@ -11,7 +11,7 @@ Elelem::Plugins.register(:execute) do |toolbox|
end
toolbox.after("execute") do |args, result|
- status = result[:exit_status] == 0 ? "ok" : "FAIL"
- $stdout.puts " #{status} #{args["command"]}"
+ status = result[:exit_status] == 0 ? "✓" : "x"
+ $stdout.puts toolbox.header("execute", args, state: status)
end
end
lib/elelem/toolbox.rb
@@ -24,9 +24,9 @@ module Elelem
@hooks[:after][tool_name] << block
end
- def header(name, args)
+ def header(name, args, state: "+")
name = tool_for(name)&.name || "#{name}?"
- "\n+ #{name}(#{args})"
+ "\n#{state} #{name}(#{args})"
end
def run(name, args)