Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change yarn to yarn.cmd on Windows #803

Merged
merged 1 commit into from
Oct 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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