cedarstalking with keyboard shortcuts
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: use environment support path instead of tmp

+10 -11
+1 -1
assets/auth-browser.swift
··· 5 5 let TARGET_HOST = "selfservice.cedarville.edu" 6 6 let AUTH_COOKIES: Set<String> = [".ASPXAUTH", "studentselfservice_live"] 7 7 let SIGN_IN_URL = URL(string: "https://selfservice.cedarville.edu/cedarinfo/directory")! 8 - let COOKIE_FILE = "/tmp/cedarsearch-cookie.txt" 8 + let COOKIE_FILE = CommandLine.arguments[1] 9 9 10 10 class CookieObserver: NSObject, WKHTTPCookieStoreObserver { 11 11 weak var browser: AuthBrowser?
+7 -6
raycast-env.d.ts
··· 7 7 8 8 /* eslint-disable @typescript-eslint/ban-types */ 9 9 10 - type ExtensionPreferences = {}; 10 + type ExtensionPreferences = {} 11 11 12 12 /** Preferences accessible in all the extension's commands */ 13 - declare type Preferences = ExtensionPreferences; 13 + declare type Preferences = ExtensionPreferences 14 14 15 15 declare namespace Preferences { 16 16 /** Preferences accessible in the `search-directory` command */ 17 17 export type SearchDirectory = ExtensionPreferences & { 18 - /** Demo Mode - Redact personal information for screenshots and demos */ 19 - demoMode: boolean; 20 - }; 18 + /** Demo Mode - Redact personal information for screenshots and demos */ 19 + "demoMode": boolean 20 + } 21 21 } 22 22 23 23 declare namespace Arguments { 24 24 /** Arguments passed to the `search-directory` command */ 25 - export type SearchDirectory = {}; 25 + export type SearchDirectory = {} 26 26 } 27 +
+2 -4
src/auth.ts
··· 9 9 const execFileAsync = promisify(execFile); 10 10 const COOKIE_KEY = "session_cookie"; 11 11 12 - // Use /tmp directly (not os.tmpdir) so paths match the Swift binary's hardcoded path. 13 - // os.tmpdir() under Raycast returns /var/folders/…/T which differs from /tmp. 14 - const COOKIE_FILE = "/tmp/cedarsearch-cookie.txt"; 12 + const COOKIE_FILE = path.join(environment.supportPath, "auth-cookie.txt"); 15 13 16 14 // ─── Cookie storage ──────────────────────────────────────────────────────── 17 15 ··· 57 55 await writeFile(COOKIE_FILE, "", { mode: 0o600 }); 58 56 59 57 await new Promise<void>((resolve, reject) => { 60 - const proc = spawn("open", ["-n", "-W", appBundle], { stdio: "ignore" }); 58 + const proc = spawn("open", ["-n", "-W", appBundle, "--args", COOKIE_FILE], { stdio: "ignore" }); 61 59 proc.on("close", () => resolve()); 62 60 proc.on("error", reject); 63 61 });