Skip to content

Commit

Permalink
create keybindings file if none exists
Browse files Browse the repository at this point in the history
  • Loading branch information
chee committed May 7, 2017
1 parent 00fdbd4 commit a0cb657
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions index.js
Expand Up @@ -33,8 +33,12 @@ async function makeDirectories () {
}

async function getCurrentBindings () {
const dictionary = (await fs.readFile(KEYBINDINGS_FILE)).toString()
return plist.parse(dictionary)
try {
const dictionary = (await fs.readFile(KEYBINDINGS_FILE)).toString()
return plist.parse(dictionary)
} catch (error) {
return {}
}
}

function stringToObject (string, value, index = 0, acc = {}, root = acc) {
Expand Down

0 comments on commit a0cb657

Please sign in to comment.