MCPcopy Create free account
hub / github.com/defold/defold / dmg

Function dmg

build_tools/unpack.py:25–37  ·  view source on GitHub ↗
(filepath, dest_dir)

Source from the content-addressed store, hash-verified

23 run.shell_command('unzip %s -d %s' % (filepath, dest_dir))
24
25def 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)

Callers

nothing calls this directly

Calls 2

logFunction · 0.90
systemMethod · 0.80

Tested by

no test coverage detected