Fix launch of external program

This commit is contained in:
2025-10-02 10:22:38 +02:00
parent 66fb0e24c8
commit 9f5c9b4fc3
2 changed files with 6 additions and 3 deletions

View File

@@ -5,8 +5,9 @@ import os.Shellable
class CommandGroup(name: String) extends BaseGroup {
override def getToolParameters: Seq[Shellable] = {
val sub = options.toSeq.map(_.getToolParameters.map(_.value).mkString("="))
Seq(s"""$name="${sub.mkString(" ")}"""")
val sub = options.toSeq.map(_.getToolParameters.flatMap(_.value).mkString("=")).filter(!_.isEmpty)
println(sub)
Seq(s"$name=\'${sub.mkString(" ")}\'")
}
override def init(scallopConf: ScallopConf, group: ScallopOptionGroup): Unit = {

View File

@@ -9,6 +9,8 @@ trait Task {
def runExecutable(execPath: Path, args: Shellable*): os.CommandResult = {
println(s"Executing $execPath with")
println(args.flatMap(_.value).mkString(" "))
os.proc(execPath, args).call()
println(args)
val command = s"$execPath ${args.flatMap(_.value).mkString(" ")}"
os.proc("bash", "-c", command).call(stdout = os.Inherit)
}
}