diff --git a/dist/post_run/index.js b/dist/post_run/index.js index 48a6923303..41405b07ad 100644 --- a/dist/post_run/index.js +++ b/dist/post_run/index.js @@ -84932,7 +84932,8 @@ function checksumFile(hashName, path) { } const pathExists = async (path) => !!(await fs.promises.stat(path).catch(() => false)); const getLintCacheDir = () => { - return path_1.default.resolve(`${process.env.HOME}/.cache/golangci-lint`); + const home = process.platform === "win32" ? "USERPROFILE" : "HOME"; + return path_1.default.resolve(`${home}/.cache/golangci-lint`); }; const getIntervalKey = (invalidationIntervalDays) => { const now = new Date(); diff --git a/dist/run/index.js b/dist/run/index.js index aaa6c48036..ab7ea530b1 100644 --- a/dist/run/index.js +++ b/dist/run/index.js @@ -84932,7 +84932,8 @@ function checksumFile(hashName, path) { } const pathExists = async (path) => !!(await fs.promises.stat(path).catch(() => false)); const getLintCacheDir = () => { - return path_1.default.resolve(`${process.env.HOME}/.cache/golangci-lint`); + const home = process.platform === "win32" ? "USERPROFILE" : "HOME"; + return path_1.default.resolve(`${home}/.cache/golangci-lint`); }; const getIntervalKey = (invalidationIntervalDays) => { const now = new Date(); diff --git a/src/cache.ts b/src/cache.ts index dc6aa06b14..5181753e70 100644 --- a/src/cache.ts +++ b/src/cache.ts @@ -20,7 +20,9 @@ function checksumFile(hashName: string, path: string): Promise { const pathExists = async (path: string): Promise => !!(await fs.promises.stat(path).catch(() => false)) const getLintCacheDir = (): string => { - return path.resolve(`${process.env.HOME}/.cache/golangci-lint`) + const home = process.platform === "win32" ? "USERPROFILE" : "HOME" + + return path.resolve(`${home}/.cache/golangci-lint`) } const getIntervalKey = (invalidationIntervalDays: number): string => {