Skip to content
This repository has been archived by the owner on Jun 6, 2022. It is now read-only.

Commit

Permalink
removed hardcoded file paths
Browse files Browse the repository at this point in the history
  • Loading branch information
pocc committed Jul 4, 2018
1 parent 67168e0 commit ecd31ca
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions pkg/dmg_settings.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
import biplist
import os.path
from os import path, getcwd

#
# Example settings file for dmgbuild
Expand All @@ -15,18 +15,20 @@

# .. Useful stuff ..............................................................

current_dir = getcwd()
print("dmgbuild directiory: " + current_dir )
application = defines.get('app', '/Applications/Merlink.app')
appname = os.path.basename(application)
appname = path.basename(application)

def icon_from_app(app_path):
plist_path = os.path.join(app_path, 'Contents', 'Info.plist')
plist_path = path.join(app_path, 'Contents', 'Info.plist')
plist = biplist.readPlist(plist_path)
icon_name = plist['CFBundleIconFile']
icon_root,icon_ext = os.path.splitext(icon_name)
icon_root,icon_ext = 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)
return path.join(app_path, 'Contents', 'Resources', icon_name)

# .. Basics ....................................................................

Expand All @@ -43,7 +45,7 @@ def icon_from_app(app_path):
#size = defines.get('size', None)

# Files to include
files = [ '/Users/Merakiuser/code/merlink/dist/merlink.app' ]
files = [ current_dir + '/dist/merlink.app' ]

# Symlinks to create
symlinks = { 'Applications': '/Applications' }
Expand All @@ -55,7 +57,7 @@ def icon_from_app(app_path):
# will be used to badge the system's Removable Disk icon
#
# badge_icon = /path/to/icon
badge_icon = icon_from_app('/Users/Merakiuser/code/merlink/dist/merlink.app')
badge_icon = icon_from_app( current_dir + '/dist/merlink.app' )
#print(appname)
#badge_icon = icon_from_app(application)

Expand Down

0 comments on commit ecd31ca

Please sign in to comment.