Skip to content

Commit

Permalink
Lazily load open3
Browse files Browse the repository at this point in the history
It's only used under very specific circumstances, so we can load it only
when needed.
  • Loading branch information
deivid-rodriguez committed Dec 6, 2019
1 parent 726b461 commit 2115b7a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/thor/actions.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require "open3"
require_relative "actions/create_file"
require_relative "actions/create_link"
require_relative "actions/directory"
Expand Down Expand Up @@ -260,6 +259,7 @@ def run(command, config = {})
env_splat = [config[:env]] if config[:env]

if config[:capture]
require "open3"
result, status = Open3.capture2e(*env_splat, command.to_s)
success = status.success?
else
Expand Down

0 comments on commit 2115b7a

Please sign in to comment.