We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent deabbc7 commit 3008712Copy full SHA for 3008712
src/getAppRootPath.ts
@@ -5,7 +5,11 @@ import { existsSync } from "fs-extra"
5
export const getAppRootPath = (): string => {
6
let cwd = process.cwd()
7
while (!existsSync(join(cwd, "package.json"))) {
8
- cwd = resolve(cwd, "../")
+ const up = resolve(cwd, "../")
9
+ if (up === cwd) {
10
+ throw new Error("no package.json found for this project")
11
+ }
12
+ cwd = up
13
}
14
return cwd
15
0 commit comments