Delete any existing dmg before recreating it.

This commit is contained in:
Josh Matthews 2017-04-01 00:14:40 -04:00 committed by GitHub
parent 325713af38
commit 3dd74bb177

View file

@ -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: