Skip to content

Commit

Permalink
Change yarn to yarn.cmd on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
JD557 authored and tgodzik committed Oct 9, 2023
1 parent dae695e commit d9ec886
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions mdoc-sbt/src/main/scala/mdoc/DocusaurusPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ object DocusaurusPlugin extends AutoPlugin {
|call yarn publish-gh-pages
""".stripMargin

lazy val yarnBin =
if (scala.util.Properties.isWin) "yarn.cmd"
else "yarn"

override def projectSettings: Seq[Def.Setting[_]] =
List(
aggregate.in(docusaurusPublishGhpages) := false,
Expand Down Expand Up @@ -121,8 +125,8 @@ object DocusaurusPlugin extends AutoPlugin {
},
docusaurusCreateSite := {
m.mdoc.in(Compile).toTask(" ").value
Process(List("yarn", "install"), cwd = website.value).execute()
Process(List("yarn", "run", "build"), cwd = website.value).execute()
Process(List(yarnBin, "install"), cwd = website.value).execute()
Process(List(yarnBin, "run", "build"), cwd = website.value).execute()
val redirectUrl = docusaurusProjectName.value + "/index.html"
val html = redirectHtml(redirectUrl)
val out = website.value / "build"
Expand Down

0 comments on commit d9ec886

Please sign in to comment.