diff options
author | Minteck <contact@minteck.org> | 2022-03-27 17:56:40 +0200 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2022-03-27 17:56:40 +0200 |
commit | 44b4222bc02f102480d1afe05d940612ff6cb983 (patch) | |
tree | 936e6baf8039e065324cd1c2e453c33ec4cf4122 /index.js | |
parent | 1d8cbd4b6a7b654c77d8cd3793bc67811a39725d (diff) | |
download | twilight-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.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);
})
|