Skip to content

Commit

Permalink
build_release: Don't fail if hdiutil detach fails
Browse files Browse the repository at this point in the history
  • Loading branch information
The-Compiler committed Jul 4, 2017
1 parent c424a74 commit 725d4a4
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions scripts/dev/build_release.py
Expand Up @@ -149,15 +149,19 @@ def build_osx():
os.rename('qutebrowser.dmg', dmg_name)

utils.print_title("Running smoke test")
with tempfile.TemporaryDirectory() as tmpdir:
subprocess.check_call(['hdiutil', 'attach', dmg_name,
'-mountpoint', tmpdir])
try:
binary = os.path.join(tmpdir, 'qutebrowser.app', 'Contents',
'MacOS', 'qutebrowser')
smoke_test(binary)
finally:
subprocess.check_call(['hdiutil', 'detach', tmpdir])

try:
with tempfile.TemporaryDirectory() as tmpdir:
subprocess.check_call(['hdiutil', 'attach', dmg_name,
'-mountpoint', tmpdir])
try:
binary = os.path.join(tmpdir, 'qutebrowser.app', 'Contents',
'MacOS', 'qutebrowser')
smoke_test(binary)
finally:
subprocess.call(['hdiutil', 'detach', tmpdir])
except PermissionError as e:
print("Failed to remove tempdir: {}".format(e))

return [(dmg_name, 'application/x-apple-diskimage', 'OS X .dmg')]

Expand Down

0 comments on commit 725d4a4

Please sign in to comment.