| 23 | run.shell_command('unzip %s -d %s' % (filepath, dest_dir)) |
| 24 | |
| 25 | def dmg(filepath, dest_dir): |
| 26 | system = platform.system() |
| 27 | if system == "Darwin": |
| 28 | run.shell_command("hdiutil attach %s" % filepath) |
| 29 | shutil.copytree("/Volumes/Defold/Defold.app", os.path.join(dest_dir, "Defold.app")) |
| 30 | run.shell_command("hdiutil detach /Volumes/Defold") |
| 31 | elif system == "Linux": |
| 32 | mountpoint = tempfile.mkdtemp() |
| 33 | run.shell_command("mount -t hfsplus %s %s" % (filepath, mountpoint)) |
| 34 | shutil.copytree(os.path.join(mountpoint, "Defold.app"), os.path.join(dest_dir, "Defold.app")) |
| 35 | run.shell_command("umount %s" % (mountpoint)) |
| 36 | else: |
| 37 | log("Unpacking .dmg is not supported on %d", system) |