From 3dd74bb1772763f981f7ba132a8721af1ab68f79 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Sat, 1 Apr 2017 00:14:40 -0400 Subject: [PATCH] Delete any existing dmg before recreating it. --- python/servo/package_commands.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/servo/package_commands.py b/python/servo/package_commands.py index 16c942efe7c..c3e29829e45 100644 --- a/python/servo/package_commands.py +++ b/python/servo/package_commands.py @@ -256,6 +256,10 @@ class PackageCommands(CommandBase): os.symlink('/Applications', path.join(dir_to_dmg, 'Applications')) dmg_path = path.join(target_dir, "servo-tech-demo.dmg") + if path.exists(dmg_path): + print("Deleting existing dmg") + os.remove(dmg_path) + try: subprocess.check_call(['hdiutil', 'create', '-volname', 'Servo', dmg_path, '-srcfolder', dir_to_dmg]) except subprocess.CalledProcessError as e: