Skip to content

Commit

Permalink
fix: home dir on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Jul 2, 2024
1 parent d8028e1 commit 2c01d26
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 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 => {
Expand Down

0 comments on commit 2c01d26

Please sign in to comment.