Skip to content

Commit 92af262

Browse files
committed
feat: ability to disable hard links on a CI server
1 parent 5d4b747 commit 92af262

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

src/util/fs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export async function walk(initialDirPath: string, filter?: Filter, consumer?: (
8383
return result
8484
}
8585

86-
const _isUseHardLink = process.platform != "win32" && (isCi || process.env.USE_HARD_LINKS === "true")
86+
const _isUseHardLink = process.platform != "win32" && process.env.USE_HARD_LINKS !== "false" && (isCi || process.env.USE_HARD_LINKS === "true")
8787

8888
/**
8989
* Hard links is used if supported and allowed.

test/jestSetup.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,6 @@ test.ifWinCi = isCi && isWindows ? test : skip
3737

3838
delete process.env.CSC_NAME
3939
process.env.CSC_IDENTITY_AUTO_DISCOVERY = "false"
40-
process.env.USE_HARD_LINKS = "true"
40+
if (!process.env.USE_HARD_LINKS) {
41+
process.env.USE_HARD_LINKS = "true"
42+
}

test/src/filesTest.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expectedWinContents } from "./helpers/expectedContents"
2-
import { outputFile, stat } from "fs-extra-p"
2+
import { outputFile, stat, readFile } from "fs-extra-p"
33
import { assertPack, modifyPackageJson, getPossiblePlatforms, app } from "./helpers/packTester"
44
import BluebirdPromise from "bluebird-lst-c"
55
import * as path from "path"
@@ -170,6 +170,8 @@ test("extraResources - one-package", () => {
170170

171171
allCan(path.join(resourcesDir, "bar", "hello.txt"), false),
172172
])
173+
174+
expect(await readFile(path.join(resourcesDir, "bar", "hello.txt"), "utf-8")).toEqual("data")
173175
},
174176
expectedContents: platform === Platform.WINDOWS ? pathSorter(expectedWinContents.concat(
175177
winDirPrefix + "bar/hello.txt",

test/src/helpers/runTests.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,10 @@ async function runTests() {
9898
const circleNodeIndex = parseInt(process.env.CIRCLE_NODE_INDEX, 10)
9999
if (circleNodeIndex === 0 || circleNodeIndex === 2) {
100100
skipWin = true
101-
args.push("linux.*", "BuildTest.js", "extraMetadataTest.js", "mainEntryTest.js", "globTest.js", "filesTest.js", "ignoreTest.js", "nsisUpdaterTest")
101+
args.push("linux.*", "BuildTest.js", "extraMetadataTest.js", "mainEntryTest.js", "globTest.js", "filesTest.js", "ignoreTest.js")
102+
if (circleNodeIndex === 0) {
103+
args.push("nsisUpdaterTest")
104+
}
102105
}
103106
else {
104107
args.push("windows.*", "mac.*")

0 commit comments

Comments
 (0)