From c9b9cb830e22b43f28d830e4a89a9882a72a37f4 Mon Sep 17 00:00:00 2001 From: Max Niederman Date: Mon, 29 Mar 2021 10:26:28 -0700 Subject: [PATCH] handle error while creating app directory --- injectors/main.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/injectors/main.js b/injectors/main.js index 342a3c3d6..339a771c0 100644 --- a/injectors/main.js +++ b/injectors/main.js @@ -23,7 +23,14 @@ exports.inject = async ({ getAppDir }) => { return false; } - await mkdir(appDir); + try { + await mkdir(appDir); + } catch (err) { + console.log('Your Discord Canary install appears to be broken.', '\n'); + console.log(`${AnsiEscapes.YELLOW}NOTE:${AnsiEscapes.RESET} This issue has been known to happen using non-official Discord Canary installs. Try using the official installation method if you're not already.`); + + return false; + } await Promise.all([ writeFile( join(appDir, 'index.js'),