mirror of
https://github.com/openai/codex.git
synced 2026-10-19 16:17:49 +00:00
Remove redundant Codex manual cache directory check (#53780)
`nearestExistingParent` already checks whether the cache path exists and is a directory. Remove the duplicate `stat` check from `usableCacheDir` in the OpenAI docs manual fetcher, retaining the existing parent lookup and write/execute permission checks. GitOrigin-RevId: 42583353bfdd06881171d8b24fa2b2d5b6fb3135
This commit is contained in:
committed by
copyberry
parent
20b4ff2f35
commit
8b507a8e45
@@ -242,13 +242,6 @@ const usableCacheDir = async (cacheDir) => {
|
||||
if (!cacheDir) return null;
|
||||
const resolved = path.resolve(cacheDir);
|
||||
|
||||
try {
|
||||
const info = await stat(resolved);
|
||||
if (!info.isDirectory()) return null;
|
||||
} catch (error) {
|
||||
if (error?.code !== "ENOENT") return null;
|
||||
}
|
||||
|
||||
const parent = await nearestExistingParent(resolved);
|
||||
if (!parent) return null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user