|
1 | 1 | import type { CancellationToken } from "vscode"; |
2 | 2 | import { Uri, window } from "vscode"; |
3 | | -import { relative, join, sep, dirname, parse, basename } from "path"; |
| 3 | +import { relative, join, sep, basename } from "path"; |
4 | 4 | import { dump, load } from "js-yaml"; |
5 | 5 | import { copy, writeFile, readFile, mkdirp } from "fs-extra"; |
6 | 6 | import type { DirectoryResult } from "tmp-promise"; |
@@ -262,26 +262,6 @@ async function copyExistingQueryPack( |
262 | 262 | await fixPackFile(queryPackDir, packRelativePath); |
263 | 263 | } |
264 | 264 |
|
265 | | -export async function findPackRoot(queryFile: string): Promise<string> { |
266 | | - // recursively find the directory containing qlpack.yml or codeql-pack.yml |
267 | | - let dir = dirname(queryFile); |
268 | | - while (!(await getQlPackFilePath(dir))) { |
269 | | - dir = dirname(dir); |
270 | | - if (isFileSystemRoot(dir)) { |
271 | | - // there is no qlpack.yml or codeql-pack.yml in this directory or any parent directory. |
272 | | - // just use the query file's directory as the pack root. |
273 | | - return dirname(queryFile); |
274 | | - } |
275 | | - } |
276 | | - |
277 | | - return dir; |
278 | | -} |
279 | | - |
280 | | -function isFileSystemRoot(dir: string): boolean { |
281 | | - const pathObj = parse(dir); |
282 | | - return pathObj.root === dir && pathObj.base === ""; |
283 | | -} |
284 | | - |
285 | 265 | interface RemoteQueryTempDir { |
286 | 266 | remoteQueryDir: DirectoryResult; |
287 | 267 | queryPackDir: string; |
|
0 commit comments