Skip to content

Commit

Permalink
Avoid a couple more errors
Browse files Browse the repository at this point in the history
  • Loading branch information
propensive committed Sep 16, 2024
1 parent 7ec3baf commit 71532ab
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/engine/build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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:

Expand Down
15 changes: 8 additions & 7 deletions src/engine/cache.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down
2 changes: 1 addition & 1 deletion src/model/model.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 71532ab

Please sign in to comment.