bin/tmux-erb-parser in tmux-erb-parser-0.1.2 vs bin/tmux-erb-parser in tmux-erb-parser-0.1.3
- old
+ new
@@ -2,7 +2,12 @@
# frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path('../lib', __dir__)
require 'tmux-erb-parser'
+# limit recursive execution
+command = File.basename(__FILE__)
+processes = `ps ax`.each_line.map { |line| line.split(' ', 5)[4] }
+exit 1 if processes.grep(/\Aruby.+#{command}/).size > 5
+
cmd = TmuxERBParser::Command.new(ARGV)
cmd.run