[build] Fix --onedir on macOS

Closes #3584
This commit is contained in:
pukkandan 2022-04-28 22:16:23 +05:30
parent 492272fed6
commit e1e1ea54ae
No known key found for this signature in database
GPG key ID: 7EEE9E1E817D0A39

View file

@ -33,9 +33,9 @@ def main():
if not onedir and '-F' not in opts and '--onefile' not in opts: if not onedir and '-F' not in opts and '--onefile' not in opts:
opts.append('--onefile') opts.append('--onefile')
suffix = '_macos' if OS_NAME == 'Darwin' else '_x86' if ARCH == '32' else '' name = 'yt-dlp%s' % ('_macos' if OS_NAME == 'Darwin' else '_x86' if ARCH == '32' else '')
final_file = 'dist/%syt-dlp%s%s' % ( final_file = ''.join((
'yt-dlp/' if onedir else '', suffix, '.exe' if OS_NAME == 'Windows' else '') 'dist/', f'{name}/' if onedir else '', name, '.exe' if OS_NAME == 'Windows' else ''))
print(f'Building yt-dlp v{version} {ARCH}bit for {OS_NAME} with options {opts}') print(f'Building yt-dlp v{version} {ARCH}bit for {OS_NAME} with options {opts}')
print('Remember to update the version using "devscripts/update-version.py"') print('Remember to update the version using "devscripts/update-version.py"')
@ -45,7 +45,7 @@ def main():
print(f'Destination: {final_file}\n') print(f'Destination: {final_file}\n')
opts = [ opts = [
f'--name=yt-dlp{suffix}', f'--name={name}',
'--icon=devscripts/logo.ico', '--icon=devscripts/logo.ico',
'--upx-exclude=vcruntime140.dll', '--upx-exclude=vcruntime140.dll',
'--noconfirm', '--noconfirm',