Skip to content

Commit

Permalink
feat: ability to disable hard links on a CI server
Browse files Browse the repository at this point in the history
  • Loading branch information
develar committed Nov 30, 2016
1 parent 5d4b747 commit 92af262
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/util/fs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export async function walk(initialDirPath: string, filter?: Filter, consumer?: (
return result
}

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

/**
* Hard links is used if supported and allowed.
Expand Down
4 changes: 3 additions & 1 deletion test/jestSetup.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,6 @@ test.ifWinCi = isCi && isWindows ? test : skip

delete process.env.CSC_NAME
process.env.CSC_IDENTITY_AUTO_DISCOVERY = "false"
process.env.USE_HARD_LINKS = "true"
if (!process.env.USE_HARD_LINKS) {
process.env.USE_HARD_LINKS = "true"
}
4 changes: 3 additions & 1 deletion test/src/filesTest.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expectedWinContents } from "./helpers/expectedContents"
import { outputFile, stat } from "fs-extra-p"
import { outputFile, stat, readFile } from "fs-extra-p"
import { assertPack, modifyPackageJson, getPossiblePlatforms, app } from "./helpers/packTester"
import BluebirdPromise from "bluebird-lst-c"
import * as path from "path"
Expand Down Expand Up @@ -170,6 +170,8 @@ test("extraResources - one-package", () => {

allCan(path.join(resourcesDir, "bar", "hello.txt"), false),
])

expect(await readFile(path.join(resourcesDir, "bar", "hello.txt"), "utf-8")).toEqual("data")
},
expectedContents: platform === Platform.WINDOWS ? pathSorter(expectedWinContents.concat(
winDirPrefix + "bar/hello.txt",
Expand Down
5 changes: 4 additions & 1 deletion test/src/helpers/runTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,10 @@ async function runTests() {
const circleNodeIndex = parseInt(process.env.CIRCLE_NODE_INDEX, 10)
if (circleNodeIndex === 0 || circleNodeIndex === 2) {
skipWin = true
args.push("linux.*", "BuildTest.js", "extraMetadataTest.js", "mainEntryTest.js", "globTest.js", "filesTest.js", "ignoreTest.js", "nsisUpdaterTest")
args.push("linux.*", "BuildTest.js", "extraMetadataTest.js", "mainEntryTest.js", "globTest.js", "filesTest.js", "ignoreTest.js")
if (circleNodeIndex === 0) {
args.push("nsisUpdaterTest")
}
}
else {
args.push("windows.*", "mac.*")
Expand Down

0 comments on commit 92af262

Please sign in to comment.