Skip to content

Commit 75c4f0d

Browse files
authored
Merge pull request #438 from bdwain/master
Copy .yarn directory to temporary directory also
2 parents cd1e385 + 776fe96 commit 75c4f0d

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

Diff for: src/makePatch.ts

+9-8
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,15 @@ export function makePatch({
110110
join(resolve(packageDetails.path), "package.json"),
111111
)
112112

113-
// copy .npmrc/.yarnrc in case packages are hosted in private registry
114-
// tslint:disable-next-line:align
115-
;[".npmrc", ".yarnrc"].forEach((rcFile) => {
116-
const rcPath = join(appPath, rcFile)
117-
if (existsSync(rcPath)) {
118-
copySync(rcPath, join(tmpRepo.name, rcFile), { dereference: true })
119-
}
120-
})
113+
// copy .npmrc/.yarnrc in case packages are hosted in private registry
114+
// copy .yarn directory as well to ensure installations work in yarn 2
115+
// tslint:disable-next-line:align
116+
;[".npmrc", ".yarnrc", ".yarn"].forEach((rcFile) => {
117+
const rcPath = join(appPath, rcFile)
118+
if (existsSync(rcPath)) {
119+
copySync(rcPath, join(tmpRepo.name, rcFile), { dereference: true })
120+
}
121+
})
121122

122123
if (packageManager === "yarn") {
123124
console.info(

0 commit comments

Comments
 (0)