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

@ -1,4 +1,5 @@
import * as fs from 'fs'
import * as os from 'os'
import * as path from 'path'
import * as httpm from 'typed-rest-client/HttpClient'
import * as unzip from 'unzipper'
@ -93,7 +94,7 @@ async function provisionGradle(version: string, url: string): Promise<string> {
return cachedExecutable
}
const home = process.env['HOME'] || ''
const home = os.homedir()
const tmpdir = path.join(home, 'gradle-provision-tmpdir')
const downloadsDir = path.join(tmpdir, 'downloads')
const installsDir = path.join(tmpdir, 'installs')