SvnRunner: add --non-interactive when not interactive

This commit is contained in:
Josh Holtrop 2018-02-12 21:35:38 -05:00
parent 94c38ade8f
commit 957f7ec0fd

View File

@ -16,6 +16,8 @@ module Svi
# Optional arguments.
# @option options [Array<String>] :global_args
# Global svn arguments to place before the subcommand.
# @option options [Boolean] :allow_interactive
# Allow interaction with svn command.
#
# @yield [line]
# If a block is given, each line that the Subversion command writes to
@ -27,9 +29,11 @@ module Svi
# @raise [SvnExecError]
# If the svn command errors out this exception is raised.
def run_svn(subcommand, args, options = {}, &block)
options[:global_args] ||= []
options[:global_args] << "--non-interactive" unless options[:allow_interactive]
command = [
"svn",
*(options[:global_args] || []),
*options[:global_args],
subcommand,
*args,
].compact