Skip to content

Commit

Permalink
Use current user and group in unit by default (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
lolgab authored Jan 14, 2025
1 parent 2d14aa9 commit da584b9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions snunit-mill-plugin/src/snunit/plugin/SNUnit.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import upickle.default._
trait SNUnit extends ScalaNativeModule {
def snunitVersion: String = snunit.plugin.internal.BuildInfo.snunitVersion
def snunitNGINXUnitVersion: Target[String] = Task { "1.34.1" }
def snunitNGINXUnitUser: Target[Option[String]] = Task.Input { T.env.get("USER") }
def snunitNGINXUnitGroup: Target[Option[String]] = Task.Input { T.env.get("GROUP") }
def snunitNGINXUnitSources = Task {
val dir = s"unit-${snunitNGINXUnitVersion()}"
val file = s"$dir.tar.gz"
Expand All @@ -30,6 +32,8 @@ trait SNUnit extends ScalaNativeModule {
"./configure",
"--logdir=./logdir",
"--log=/dev/stdout",
snunitNGINXUnitUser().map(user => s"--user=$user"),
snunitNGINXUnitGroup().map(group => s"--group=$group"),
"--runstatedir=./runstatedir",
"--pid=unit.pid",
"--control=unix:control.sock",
Expand Down

0 comments on commit da584b9

Please sign in to comment.