From 44b4222bc02f102480d1afe05d940612ff6cb983 Mon Sep 17 00:00:00 2001 From: Minteck Date: Sun, 27 Mar 2022 17:56:40 +0200 Subject: WIP Alicorn port (abandonned, To be removed) --- index.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'index.js') diff --git a/index.js b/index.js index eaa84f3..7c0b078 100644 --- a/index.js +++ b/index.js @@ -23,6 +23,12 @@ * */ +if (require('fs').existsSync("emuAlicorn") || require('fs').existsSync('/System/AlicornCore')) { + global.twiplatform = "alicorn"; +} else { + global.twiplatform = require('os').platform(); +} + process.on('uncaughtException', async (e) => { global.c = (await import('chalk')).default; @@ -34,7 +40,11 @@ process.on('uncaughtException', async (e) => { fs.writeFileSync(require('os').homedir() + "/.twilight/crashes/" + date + ".txt", e.stack); console.log(c.red("error:") + " an internal error occurred, did you forget to run 'twi update'?"); - console.log(" additionally, a crash report has been saved to:\n " + require('os').homedir() + (require('os').platform() === "win32" ? "\\" : "/") + ".twilight" + (require('os').platform() === "win32" ? "\\" : "/") + "crashes" + (require('os').platform() === "win32" ? "\\" : "/") + date + ".txt") + if (twiplatform === "alicorn") { + console.log(" additionally, a crash report has been saved to:\n /Library/Logs/TwilightCrashes/" + date + ".txt") + } else { + console.log(" additionally, a crash report has been saved to:\n " + require('os').homedir() + (twiplatform === "win32" ? "\\" : "/") + ".twilight" + (twiplatform === "win32" ? "\\" : "/") + "crashes" + (twiplatform === "win32" ? "\\" : "/") + date + ".txt") + } process.exit(2); }) -- cgit