aboutsummaryrefslogtreecommitdiff
path: root/index.js
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2022-03-27 17:56:40 +0200
committerMinteck <contact@minteck.org>2022-03-27 17:56:40 +0200
commit44b4222bc02f102480d1afe05d940612ff6cb983 (patch)
tree936e6baf8039e065324cd1c2e453c33ec4cf4122 /index.js
parent1d8cbd4b6a7b654c77d8cd3793bc67811a39725d (diff)
downloadtwilight-44b4222bc02f102480d1afe05d940612ff6cb983.tar.gz
twilight-44b4222bc02f102480d1afe05d940612ff6cb983.tar.bz2
twilight-44b4222bc02f102480d1afe05d940612ff6cb983.zip
WIP Alicorn port (abandonned, To be removed)
Diffstat (limited to 'index.js')
-rw-r--r--index.js12
1 files changed, 11 insertions, 1 deletions
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);
})