Skip to content

Commit 6151c6d

Browse files
committed
Expose debug output for all spec commands
Also support the DEBUG env variable in addition to the `$DEBUG` global ruby variable.
1 parent 0591deb commit 6151c6d

2 files changed

Lines changed: 14 additions & 8 deletions

File tree

lib/solidus_dev_support/templates/extension/bin/sandbox.tt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#!/usr/bin/env bash
22

33
set -e
4+
if [ ! -z $DEBUG ]
5+
then
6+
set -x
7+
fi
48

59
case "$DB" in
610
postgres|postgresql)

spec/features/create_extension_spec.rb

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -159,16 +159,18 @@ def sh(*args)
159159
Open3.capture2e({ 'CI' => nil }, command)
160160
end
161161

162-
if status.success?
163-
output.to_s
164-
else
165-
if $DEBUG
166-
warn '~' * 80
167-
warn "$ #{command}"
168-
warn output.to_s
169-
end
162+
if $DEBUG || ENV['DEBUG']
163+
warn '~' * 80
164+
warn "$ #{command}"
165+
warn output.to_s
166+
warn "$ #{command} ~~~~> EXIT STATUS: #{status.exitstatus}"
167+
end
168+
169+
unless status.success?
170170
raise(command_failed_error, "command failed: #{command}\n#{output}")
171171
end
172+
173+
output.to_s
172174
end
173175

174176
def with_unbundled_env(&block)

0 commit comments

Comments
 (0)