|
1 |
| -import { exec, getTempName, isEmptyOrSpaces, isCi } from "./util/util" |
| 1 | +import { exec, getTempName, isEmptyOrSpaces, isCi, getCacheDirectory } from "./util/util" |
2 | 2 | import { deleteFile, outputFile, copy, rename } from "fs-extra-p"
|
3 | 3 | import { download } from "./util/httpRequest"
|
4 | 4 | import * as path from "path"
|
5 | 5 | import { executeFinally, all } from "./util/promise"
|
6 | 6 | import BluebirdPromise from "bluebird-lst-c"
|
7 | 7 | import { randomBytes } from "crypto"
|
8 |
| -import { homedir } from "os" |
9 | 8 | import { TmpDir } from "./util/tmp"
|
10 | 9 |
|
11 | 10 | const appleCertificatePrefixes = ["Developer ID Application:", "3rd Party Mac Developer Application:", "Developer ID Installer:", "3rd Party Mac Developer Installer:"]
|
@@ -39,8 +38,8 @@ let bundledCertKeychainAdded: Promise<any> | null = null
|
39 | 38 | // https://github.com/electron-userland/electron-builder/issues/398
|
40 | 39 | async function createCustomCertKeychain() {
|
41 | 40 | // copy to temp and then atomic rename to final path
|
42 |
| - const tmpKeychainPath = path.join(homedir(), ".cache", getTempName("electron_builder_root_certs")) |
43 |
| - const keychainPath = path.join(homedir(), ".cache", "electron_builder_root_certs.keychain") |
| 41 | + const tmpKeychainPath = path.join(getCacheDirectory(), getTempName("electron-builder-root-certs")) |
| 42 | + const keychainPath = path.join(getCacheDirectory(), "electron-builder-root-certs.keychain") |
44 | 43 | const results = await BluebirdPromise.all<string>([
|
45 | 44 | exec("security", ["list-keychains"]),
|
46 | 45 | copy(path.join(__dirname, "..", "certs", "root_certs.keychain"), tmpKeychainPath)
|
|
0 commit comments