From a0cb65794e65353aaded95cc48de95f1fca3f440 Mon Sep 17 00:00:00 2001 From: chee Date: Sun, 7 May 2017 20:41:09 +0100 Subject: [PATCH] create keybindings file if none exists --- index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 7217ad1..d39cee6 100644 --- a/index.js +++ b/index.js @@ -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) {