Skip to content

Commit 2c01d26

Browse files
committedJul 2, 2024
fix: home dir on Windows
1 parent d8028e1 commit 2c01d26

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎src/cache.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ function checksumFile(hashName: string, path: string): Promise<string> {
2020
const pathExists = async (path: string): Promise<boolean> => !!(await fs.promises.stat(path).catch(() => false))
2121

2222
const getLintCacheDir = (): string => {
23-
return path.resolve(`${process.env.HOME}/.cache/golangci-lint`)
23+
const home = process.platform === "win32" ? process.env.USERPROFILE : process.env.HOME
24+
25+
return path.resolve(`${home}`, `.cache`, `golangci-lint`)
2426
}
2527

2628
const getIntervalKey = (invalidationIntervalDays: number): string => {

0 commit comments

Comments
 (0)