Locate user home in an OS agnostic way

This commit is contained in:
Paul Merlin
2020-06-14 12:28:17 +02:00
parent 83e6d042d7
commit c839ac993c
4 changed files with 6 additions and 4 deletions

View File

@@ -2,6 +2,7 @@ import * as core from '@actions/core'
import * as cache from '@actions/cache'
import * as path from 'path'
import * as fs from 'fs'
import * as os from 'os'
const WRAPPER_CACHE_KEY = 'WRAPPER_CACHE_KEY'
const WRAPPER_CACHE_PATH = 'WRAPPER_CACHE_PATH'
@@ -20,7 +21,7 @@ export async function restoreCachedWrapperDist(
const wrapperCacheKey = `wrapper-${wrapperSlug}`
const wrapperCachePath = path.join(
process.env.HOME!,
os.homedir(),
`.gradle/wrapper/dists/gradle-${wrapperSlug}`
)