From 01959116068e93b56c876963eb36292980bb57f7 Mon Sep 17 00:00:00 2001 From: Oliver Blanthorn Date: Fri, 11 May 2018 21:33:10 +0100 Subject: [PATCH] Add a bunch of hacks to fix #518 --- src/config_rc.ts | 3 ++- src/excmds.ts | 2 +- src/native_background.ts | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/config_rc.ts b/src/config_rc.ts index 93bb45ad..327a793d 100644 --- a/src/config_rc.ts +++ b/src/config_rc.ts @@ -10,8 +10,9 @@ export async function source(filename = "auto") { } else { rctext = (await Native.read(filename)).content } - + if (rctext === undefined) return false runRc(rctext) + return true } export async function runRc(rc: string) { diff --git a/src/excmds.ts b/src/excmds.ts index ede3fc24..17714328 100644 --- a/src/excmds.ts +++ b/src/excmds.ts @@ -324,7 +324,7 @@ export async function installnative() { //#background export async function source(...fileArr: string[]) { const file = fileArr.join(" ") || undefined - if (await Native.nativegate("0.1.3")) rc.source(file) + if (await Native.nativegate("0.1.3")) if (!await rc.source(file)) logger.error("Could not find RC file") } /** diff --git a/src/native_background.ts b/src/native_background.ts index 1b5c4066..14fa64d2 100644 --- a/src/native_background.ts +++ b/src/native_background.ts @@ -58,7 +58,8 @@ export async function getrc(): Promise { logger.info(`Successfully retrieved fs config:\n${res.content}`) return res.content } else { - logger.error(`Error in retrieving config: ${res.error}`) + // Have to make this a warning as async exceptions apparently don't get caught + logger.info(`Error in retrieving config: ${res.error}`) } }