duplicate path function

This commit is contained in:
Evan 2025-02-06 18:28:42 -08:00
parent a31b394282
commit 6cfdd4fb90
3 changed files with 3 additions and 11 deletions

View file

@ -1,7 +1,7 @@
import { globby, Options } from "globby"
import os from "os"
import * as path from "path"
import { arePathsEqual, pathExists } from "../../utils/path"
import { arePathsEqual } from "../../utils/path"
export async function listFiles(dirPath: string, recursive: boolean, limit: number): Promise<[string[], boolean]> {
const absolutePath = path.resolve(dirPath)

View file

@ -2,8 +2,8 @@ import * as vscode from "vscode"
import * as childProcess from "child_process"
import * as path from "path"
import * as readline from "readline"
import { pathExists } from "../../utils/path"
import { LLMFileAccessController } from "../llm-access-control/LLMFileAccessController"
import { fileExistsAtPath } from "../../utils/fs"
/*
This file provides functionality to perform regex searches on files using ripgrep.
@ -64,7 +64,7 @@ const MAX_RESULTS = 300
async function getBinPath(vscodeAppRoot: string): Promise<string | undefined> {
const checkPath = async (pkgFolder: string) => {
const fullPath = path.join(vscodeAppRoot, pkgFolder, binName)
return (await pathExists(fullPath)) ? fullPath : undefined
return (await fileExistsAtPath(fullPath)) ? fullPath : undefined
}
return (

View file

@ -100,11 +100,3 @@ export function getReadablePath(cwd: string, relPath?: string): string {
}
}
}
export async function pathExists(path: string): Promise<boolean> {
return new Promise((resolve) => {
fs.access(path, (err) => {
resolve(err === null)
})
})
}