From 2376dd1a0f0a3ffb719f9da625fa7ef25df90c00 Mon Sep 17 00:00:00 2001 From: Ben Gotow Date: Tue, 8 Mar 2016 10:54:39 -0800 Subject: [PATCH] fix(specs): Override configDirPath when running specs within app. Fixes #1133 --- src/browser/application.coffee | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/browser/application.coffee b/src/browser/application.coffee index b3488bbb6..4dd49189d 100644 --- a/src/browser/application.coffee +++ b/src/browser/application.coffee @@ -539,4 +539,9 @@ class Application isSpec = true devMode = true safeMode ?= false - new NylasWindow({bootstrapScript, @configDirPath, resourcePath, exitWhenDone, isSpec, devMode, specDirectory, specFilePattern, logFile, safeMode, showSpecsInWindow}) + + # Important: Use .nylas-spec instead of .nylas to avoid overwriting the + # user's real email config! + configDirPath = path.join(app.getPath('home'), '.nylas-spec') + + new NylasWindow({bootstrapScript, configDirPath, resourcePath, exitWhenDone, isSpec, devMode, specDirectory, specFilePattern, logFile, safeMode, showSpecsInWindow})