From f613486bb81e26e9be68e8c94de6855c1c728f79 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sat, 19 Mar 2016 16:42:00 -0700 Subject: [PATCH] Fix merge mistake --- bin/package.js | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/bin/package.js b/bin/package.js index 3cf68088..3ee0cd2b 100755 --- a/bin/package.js +++ b/bin/package.js @@ -147,14 +147,27 @@ function buildDarwin (cb) { 'static', 'WebTorrentFile.icns' ) - var infoPlist = plist.parse(fs.readFileSync(infoPlistPath).toString()) + var infoPlist = plist.parse(fs.readFileSync(infoPlistPath, 'utf8')) - infoPlist['CFBundleDocumentTypes'] = [{ - CFBundleTypeExtensions: [ 'torrent' ], - CFBundleTypeName: 'BitTorrent Document', - CFBundleTypeRole: 'Editor', - CFBundleTypeIconFile: 'WebTorrentFile.icns' - }] + infoPlist.CFBundleDocumentTypes = [ + { + CFBundleTypeExtensions: [ 'torrent' ], + CFBundleTypeIconFile: 'WebTorrentFile.icns', + CFBundleTypeName: 'BitTorrent Document', + CFBundleTypeRole: 'Editor', + LSHandlerRank: 'Owner', + LSItemContentTypes: [ 'org.bittorrent.torrent' ] + }, + { + CFBundleTypeName: 'Any', + CFBundleTypeOSTypes: [ '****' ], + CFBundleTypeRole: 'Editor', + LSHandlerRank: 'Owner', + LSTypeIsPackage: false + } + ] + + infoPlist.NSHumanReadableCopyright = 'Copyright © 2014-2016 The WebTorrent Project' fs.writeFileSync(infoPlistPath, plist.build(infoPlist)) cp.execSync(`cp ${webTorrentFileIconPath} ${resourcesPath}`)