fix: home dir on Windows

This commit is contained in:
Fernandez Ludovic 2024-07-03 00:49:42 +02:00
parent d8028e1f20
commit 2c01d264ab

View File

@ -20,7 +20,9 @@ function checksumFile(hashName: string, path: string): Promise<string> {
const pathExists = async (path: string): Promise<boolean> => !!(await fs.promises.stat(path).catch(() => false)) const pathExists = async (path: string): Promise<boolean> => !!(await fs.promises.stat(path).catch(() => false))
const getLintCacheDir = (): string => { const getLintCacheDir = (): string => {
return path.resolve(`${process.env.HOME}/.cache/golangci-lint`) const home = process.platform === "win32" ? process.env.USERPROFILE : process.env.HOME
return path.resolve(`${home}`, `.cache`, `golangci-lint`)
} }
const getIntervalKey = (invalidationIntervalDays: number): string => { const getIntervalKey = (invalidationIntervalDays: number): string => {