mirror of
https://github.com/atom/atom.git
synced 2026-01-24 14:28:14 -05:00
Set metadata to empty hash when missing
This commit is contained in:
committed by
Corey Johnson & Kevin Sawicki
parent
cd56d0a1d2
commit
856b378f54
@@ -24,9 +24,10 @@ class AtomPackage extends Package
|
||||
loadMetadata: ->
|
||||
if metadataPath = fs.resolveExtension(fs.join(@path, "package"), ['cson', 'json'])
|
||||
@metadata = fs.readObject(metadataPath)
|
||||
@metadata ?= {}
|
||||
|
||||
loadKeymaps: ->
|
||||
if keymaps = @metadata?.keymaps
|
||||
if keymaps = @metadata.keymaps
|
||||
keymaps = keymaps.map (relativePath) =>
|
||||
fs.resolve(@keymapsDirPath, relativePath, ['cson', 'json', ''])
|
||||
keymap.load(keymapPath) for keymapPath in keymaps
|
||||
|
||||
Reference in New Issue
Block a user