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 543fdbe
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ trait WorkerMain[S] {
} catch {
case AnnexWorkerError(code, _, _) => code
}
}(ec)
}(scala.concurrent.ExecutionContext.global)

f.onComplete {
case Success(code) => {
Expand Down
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 543fdbe

Please sign in to comment.