diff options
Diffstat (limited to 'index.js')
-rw-r--r-- | index.js | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -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);
})
|