mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
duplicate path function
This commit is contained in:
parent
a31b394282
commit
6cfdd4fb90
3 changed files with 3 additions and 11 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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 (
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue