From 71532ab8c93ec9cc7b3674d027a09ae71cd048a9 Mon Sep 17 00:00:00 2001 From: Jon Pretty Date: Mon, 16 Sep 2024 17:08:12 +0100 Subject: [PATCH] Avoid a couple more errors --- src/engine/build.scala | 4 ++-- src/engine/cache.scala | 15 ++++++++------- src/model/model.scala | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/engine/build.scala b/src/engine/build.scala index 06f3cef..8226f2d 100644 --- a/src/engine/build.scala +++ b/src/engine/build.scala @@ -157,7 +157,7 @@ class Builder(): val suffixPaths = artifact.suffixes.map(workspace(_)) val counterPath = artifact.counter.let(workspace(_)) - val resourceMap: Map[Path, SafeLink] = + val resourceMap: Map[Path, SafeRelative] = artifact.resources.map: resource => val path = workspace(resource.path) (path, resource.jarPath.lay(? / unsafely(Name(path.name)))(_.link)) @@ -257,7 +257,7 @@ class Builder(): prefixPaths: List[Path], suffixPaths: List[Path], counterPath: Optional[Path], - resourceMap: Map[Path, SafeLink], + resourceMap: Map[Path, SafeRelative], watches: Set[Path]) extends Phase: diff --git a/src/engine/cache.scala b/src/engine/cache.scala index 68b95a6..41b53d1 100644 --- a/src/engine/cache.scala +++ b/src/engine/cache.scala @@ -140,13 +140,14 @@ object Cache: Log.info(m"Cloning ${ecosystem.url}") val process = - given VaultError mitigates GitError = _ => VaultError() - given VaultError mitigates IoError = _ => VaultError() - given VaultError mitigates ExecError = _ => VaultError() - given VaultError mitigates PathError = _ => VaultError() - - given GitEvent is Loggable = Log.silent - Git.clone(ecosystem.url, destination, branch = ecosystem.branch) + tend: + case GitError(detail) => VaultError() + case IoError(path) => VaultError() + case ExecError(command, _, _) => VaultError() + case PathError(path, reason) => VaultError() + .within: + given GitEvent is Loggable = Log.silent + Git.clone(ecosystem.url, destination, branch = ecosystem.branch) process.complete().also: Log.info(m"Finished cloning ${ecosystem.url}") diff --git a/src/model/model.scala b/src/model/model.scala index 821dae6..8815629 100644 --- a/src/model/model.scala +++ b/src/model/model.scala @@ -375,7 +375,7 @@ object WorkPath: def add(left: Path, right: WorkPath): Path = right.descent.reverse.foldLeft(left)(_ / _) case class WorkPath(descent: List[Name[GeneralForbidden]]): - def link: SafeLink = SafeLink(0, descent) + def link: SafeRelative = SafeRelative(0, descent) case class Definition (name: Text,