@@ -5,7 +5,7 @@ import { parse as parsePlist } from "plist"
5
5
import { CSC_LINK , CSC_KEY_PASSWORD , CSC_INSTALLER_LINK , CSC_INSTALLER_KEY_PASSWORD } from "./codeSignData"
6
6
import { expectedLinuxContents , expectedWinContents } from "./expectedContents"
7
7
import { Packager , PackagerOptions , Platform , getProductName , ArtifactCreated , Arch , DIR_TARGET } from "out"
8
- import { exec } from "out/util"
8
+ import { exec , getTempName } from "out/util"
9
9
import { tmpdir } from "os"
10
10
import DecompressZip = require( "decompress-zip" )
11
11
import { getArchSuffix } from "out/platformPackager"
@@ -14,9 +14,6 @@ import pathSorter = require("path-sort")
14
14
//noinspection JSUnusedLocalSymbols
15
15
const __awaiter = require ( "out/awaiter" )
16
16
17
- const tmpDirPrefix = "electron-builder-test-" + process . pid + "-"
18
- let tmpDirCounter = 0
19
-
20
17
if ( process . env . TRAVIS !== "true" ) {
21
18
// we don't use CircleCI, so, we can safely set this env
22
19
process . env . CIRCLE_BUILD_NUM = 42
@@ -42,7 +39,7 @@ export async function assertPack(fixtureName: string, packagerOptions: PackagerO
42
39
const customTmpDir = process . env . TEST_APP_TMP_DIR
43
40
if ( useTempDir ) {
44
41
// non-osx test uses the same dir as osx test, but we cannot share node_modules (because tests executed in parallel)
45
- const dir = customTmpDir == null ? path . join ( tmpdir ( ) , `${ tmpDirPrefix } ${ fixtureName } - ${ tmpDirCounter ++ } ` ) : path . resolve ( customTmpDir )
42
+ const dir = customTmpDir == null ? path . join ( tmpdir ( ) , `${ getTempName ( "electron-builder-test" ) } - ${ fixtureName } }` ) : path . resolve ( customTmpDir )
46
43
if ( customTmpDir != null ) {
47
44
console . log ( "Custom temp dir used: %s" , customTmpDir )
48
45
}
0 commit comments