33 """Create the asset."""
34 if platform.system() !=
'Darwin':
35 print(
"This script can only be run on a Mac!")
38 subprocess.check_call([
"curl", NDK_URL,
"-o", DMG])
39 output = subprocess.check_output([
'hdiutil',
'attach', DMG])
42 lines = output.decode(
'utf-8').split(
'\n')
45 words = line.split(
'\t')
47 if words[2].startswith(MOUNTED_NAME_START):
52 if os.path.isdir(target_dir):
55 shutil.copytree(
find_ndk(words[2]), target_dir)
58 subprocess.check_call([
'hdiutil',
'detach', words[0].strip()])
60 subprocess.check_call([
"rm", DMG])
64 print(
"Could not find mount point! Output from hdiutil attach:")