Skip to content

Commit 007b134

Browse files
committedDec 12, 2020
fix(packager): fix project root resolving, so .git folder has lowest priority
1 parent 33b7338 commit 007b134

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed
 

‎package.json

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
],
1515
"scripts": {
1616
"prepublishOnly": "npm run build",
17+
"postinstall": "npm run build",
1718
"precommit": "npm run lint",
1819
"build": "npm run clean && tsc",
1920
"clean": "rm -rf ./dist",

‎src/utils.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ export function findUp(name: string, directory: string = process.cwd()): string
9292
*/
9393
export function findProjectRoot(rootDir?: string): string | undefined {
9494
return rootDir
95-
?? findUp(`.git${path.sep}`)
9695
?? findUp('yarn.lock')
9796
?? findUp('package-lock.json')
98-
?? findUp('package.json');
97+
?? findUp('package.json')
98+
?? findUp(`.git${path.sep}`);
9999
}
100100

101101
/**

0 commit comments

Comments
 (0)