File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -162,13 +162,15 @@ def environment_string
162
162
end
163
163
164
164
def with ( &_block )
165
- return yield unless environment_hash . any?
166
- "( export #{ environment_string } ; #{ yield } )"
165
+ env_string = environment_string
166
+ return yield if env_string . empty?
167
+ "( export #{ env_string } ; #{ yield } )"
167
168
end
168
169
169
170
def user ( &_block )
170
171
return yield unless options [ :user ]
171
- "sudo -u #{ options [ :user ] . to_s . shellescape } #{ environment_string + " " unless environment_string . empty? } -- sh -c #{ yield . shellescape } "
172
+ env_string = environment_string
173
+ "sudo -u #{ options [ :user ] . to_s . shellescape } #{ env_string + " " unless env_string . empty? } -- sh -c #{ yield . shellescape } "
172
174
end
173
175
174
176
def in_background ( &_block )
You can’t perform that action at this time.
0 commit comments