diff --git a/lib/grntest/executors/base-executor.rb b/lib/grntest/executors/base-executor.rb index 427b184..ed884ea 100644 --- a/lib/grntest/executors/base-executor.rb +++ b/lib/grntest/executors/base-executor.rb @@ -194,6 +194,18 @@ def execute_directive_copy_path(line, content, options) end end + def execute_directive_list_files(line, content, options) + raw_path = options.first + if raw_path.nil? + log_input(line) + log_error("#|e| [file-exist] path is missing") + end + path = Pathname(expand_variables(raw_path)) + path.parent.glob('**/*').each do |entry| + log_output("#{entry.basename}") + end + end + def timeout_value(key, line, input, default) new_value = nil @@ -628,6 +640,8 @@ def execute_directive(parser, line, content) execute_directive_include(line, content, options) when "copy-path" execute_directive_copy_path(line, content, options) + when "list-files" + execute_directive_list_files(line, content, options) when "timeout" execute_directive_timeout(line, content, options) when "read-timeout"