Closed ikhz closed 2 years ago
fix
# Updates name of binary from mac to applications name
@staticmethod
def _mac_binary_rename(temp_name, app_name):
bin_dir = os.path.join(temp_name, "Contents", "MacOS")
plist = os.path.join(temp_name, "Contents", "Info.plist")
bin_name = 'mac' if not os.uname().machine == 'arm64' else 'mac-arm'
with ChDir(bin_dir):
os.rename(bin_name, app_name)
# We also have to update to ensure app launches correctly
with io.open(plist, "r", encoding="utf-8") as f:
plist_data = f.readlines()
new_plist_data = []
for d in plist_data:
if bin_name in d:
new_plist_data.append(d.replace(bin_name, app_name))
else:
new_plist_data.append(d)
with io.open(plist, "w", encoding="utf-8") as f:
for d in new_plist_data:
f.write(d)
its trying to rename 'mac' binary but its named 'mac-arm'