Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
James Judd committed Jul 7, 2024
1 parent d0689f8 commit 641d29a
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,22 @@ object ZincRunner extends WorkerMain[Namespace] {
parser.parseArgsOrFail(args.getOrElse(Array.empty))
}

protected[this] def work(worker: Namespace, args: Array[String], out: PrintStream) = {
new ZincRunner(worker, args, out).work()
}
}

class ZincRunner(worker: Namespace, args: Array[String], out: PrintStream) {

private[this] def labelToPath(label: String): Path = {
Paths.get(label.replaceAll("^/+", "").replaceAll(raw"[^\w/]", "_"))
}

private def pathFrom(args: Namespace, name: String): Option[Path] = Option(args.getString(name)).map { dir =>
Paths.get(dir.replace("~", sys.props.getOrElse("user.home", "")))
}

protected[this] def work(worker: Namespace, args: Array[String], out: PrintStream) = {
def work() = {
val usePersistence: Boolean = worker.getBoolean("use_persistence") match {
case p: java.lang.Boolean => p
case null => true
Expand Down

0 comments on commit 641d29a

Please sign in to comment.