Skip to content

Commit

Permalink
appdmg: update for dmgbuild 1.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
albertosottile committed Oct 20, 2020
1 parent 594ca8b commit 7b8cb3b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions appdmg.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
# -*- coding: utf-8 -*-


import biplist
import os.path

import plistlib

application = defines.get('app', 'dist/Syncplay.app')
appname = os.path.basename(application)

def read_plist(path):
with open(path, 'rb') as f:
return plistlib.load(f)

def icon_from_app(app_path):
plist_path = os.path.join(app_path, 'Contents', 'Info.plist')
plist = biplist.readPlist(plist_path)
plist = read_plist(plist_path)
icon_name = plist['CFBundleIconFile']
icon_root, icon_ext = os.path.splitext(icon_name)
if not icon_ext:
icon_ext = '.icns'
icon_name = icon_root + icon_ext
return os.path.join(app_path, 'Contents', 'Resources', icon_name)


# Volume format (see hdiutil create -help)
format = defines.get('format', 'UDZO')

Expand Down

0 comments on commit 7b8cb3b

Please sign in to comment.