Skip to content

Commit c4d8214

Browse files
committed
Fix yarn install command on PackageHub
1 parent cb5116f commit c4d8214

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packagehub/src/main/scala/com/sourcegraph/packagehub/PackageActor.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,10 @@ class PackageActor(
247247
return dump
248248
pkg match {
249249
case _: NpmPackage =>
250-
exec(sourceroot, List("yarn", "install"))
250+
val toolVersions = sourceroot.resolve(".tool-versions")
251+
if (!Files.isRegularFile(toolVersions)) {
252+
Files.write(toolVersions, List("yarn 1.22.4").asJava)
253+
}
251254
val tsconfig = sourceroot.resolve("tsconfig.json")
252255
if (!Files.isRegularFile(tsconfig)) {
253256
val config = Obj(
@@ -256,6 +259,7 @@ class PackageActor(
256259
)
257260
Files.write(tsconfig, List(ujson.write(config, indent = 2)).asJava)
258261
}
262+
exec(sourceroot, List("yarn", "install"))
259263
exec(
260264
sourceroot,
261265
List("npx", "@olafurpg/lsif-tsc", "-p", sourceroot.toString)

0 commit comments

Comments
 (0)