-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cleaner semantic search implementation
- Loading branch information
Showing
14 changed files
with
195 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,10 @@ | ||
import path from "path"; | ||
import { app, nativeImage } from "electron"; | ||
import { createWriteStream } from "fs"; | ||
import isDev from "electron-is-dev"; | ||
|
||
const APP_PATH = app.getAppPath(); | ||
export const RESOURCES_PATH = APP_PATH.endsWith("app.asar") | ||
? path.dirname(APP_PATH) // If we're bundled, resources are above the bundle | ||
: APP_PATH.split("build")[0]; // Otherwise everything is in the root of the app | ||
export const LOGS_PATH = app.getPath("logs"); | ||
export const logPath = path.join(LOGS_PATH, `run-${new Date().toISOString()}.log`); | ||
export const logStream = createWriteStream(logPath); | ||
export const mainAppIconDevPng = nativeImage.createFromPath(path.join(RESOURCES_PATH, "assets", "icon.png")); | ||
export const debugLoggingEnabled = isDev && process.env.DEBUG_LOGGING === "true"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import fs, { createWriteStream } from "fs"; | ||
import path from "path"; | ||
import { threadId } from "node:worker_threads"; | ||
import os from "os"; | ||
import { appPath } from "./versions"; | ||
|
||
const isDev = process.env.NODE_ENV !== "production"; | ||
const Logs = path.join(os.homedir(), "Library", "Logs", appPath); | ||
// ensure directory exists recursively | ||
if (!fs.existsSync(Logs)) { | ||
fs.mkdirSync(Logs, { recursive: true }); | ||
} | ||
const workerPrefix = threadId ? `worker-${threadId}-` : ""; | ||
export const logPath = path.join(Logs, `${isDev ? "dev-" : ""}${workerPrefix}run-${new Date().toISOString()}.log`); | ||
export const logStream = createWriteStream(logPath); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.