|
1 | 1 | import { existsSync } from "node:fs"; |
2 | 2 | import path from "node:path"; |
3 | | -import { findUpSync } from "find-up"; |
| 3 | +import * as find from "empathic/find"; |
4 | 4 | import dedent from "ts-dedent"; |
5 | 5 | import { PATH_TO_DEPLOY_CONFIG } from "../constants"; |
6 | 6 | import { UserError } from "../errors"; |
@@ -61,9 +61,9 @@ export function findWranglerConfig( |
61 | 61 | { useRedirectIfAvailable = false } = {} |
62 | 62 | ): ConfigPaths { |
63 | 63 | const userConfigPath = |
64 | | - findUpSync(`wrangler.json`, { cwd: referencePath }) ?? |
65 | | - findUpSync(`wrangler.jsonc`, { cwd: referencePath }) ?? |
66 | | - findUpSync(`wrangler.toml`, { cwd: referencePath }); |
| 64 | + find.file(`wrangler.json`, { cwd: referencePath }) ?? |
| 65 | + find.file(`wrangler.jsonc`, { cwd: referencePath }) ?? |
| 66 | + find.file(`wrangler.toml`, { cwd: referencePath }); |
67 | 67 |
|
68 | 68 | if (!useRedirectIfAvailable) { |
69 | 69 | return { |
@@ -99,7 +99,7 @@ function findRedirectedWranglerConfig( |
99 | 99 | deployConfigPath: string | undefined; |
100 | 100 | redirected: boolean; |
101 | 101 | } { |
102 | | - const deployConfigPath = findUpSync(PATH_TO_DEPLOY_CONFIG, { cwd }); |
| 102 | + const deployConfigPath = find.file(PATH_TO_DEPLOY_CONFIG, { cwd }); |
103 | 103 | if (deployConfigPath === undefined) { |
104 | 104 | return { configPath: userConfigPath, deployConfigPath, redirected: false }; |
105 | 105 | } |
|
0 commit comments