Merge pull request #158 from feross/osx-dock
Dock icon should accept all file types
This commit is contained in:
@@ -153,14 +153,27 @@ function postDarwinism () {
|
||||
'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',
|
||||
LSTypeIsPackage: false,
|
||||
LSHandlerRank: 'Owner'
|
||||
}
|
||||
]
|
||||
|
||||
infoPlist.NSHumanReadableCopyright = 'Copyright © 2014-2016 The WebTorrent Project'
|
||||
|
||||
fs.writeFileSync(infoPlistPath, plist.build(infoPlist))
|
||||
cp.execSync(`cp ${webTorrentFileIconPath} ${resourcesPath}`)
|
||||
|
||||
Reference in New Issue
Block a user