We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6094cb5 commit 9c85a94Copy full SHA for 9c85a94
1 file changed
tool/lib/vcs.rb
@@ -51,23 +51,9 @@ def popen(*args)
51
end
52
using DebugPOpen
53
module DebugSystem
54
- def system(*args)
+ def system(*args, exception: true, **opts)
55
VCS.dump(args, "args: ") if $DEBUG
56
- exception = false
57
- opts = Hash.try_convert(args[-1])
58
- if RUBY_VERSION >= "2.6"
59
- unless opts
60
- opts = {}
61
- args << opts
62
- end
63
- exception = opts.fetch(:exception) {opts[:exception] = true}
64
- elsif opts
65
- exception = opts.delete(:exception) {true}
66
- args.pop if opts.empty?
67
68
- ret = super(*args)
69
- raise "Command failed with status (#$?): #{args[0]}" if exception and !ret
70
- ret
+ super(*args, exception: exception, **opts)
71
72
73
0 commit comments