Skip to content

Commit

Permalink
Rename exceptionDiagnostics to errorDiagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
propensive committed Oct 3, 2024
1 parent 5cb0df0 commit 78bff97
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/core/guillotine.Computable.scala
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ object Computable:
given [PathType: SpecificPath] => PathType is Computable =
proc => SpecificPath(text.compute(proc))

@capability
trait Computable:
type Self
def compute(process: java.lang.Process): Self
Expand Down
9 changes: 6 additions & 3 deletions src/core/guillotine.Process.scala
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@ import turbulence.*
import vacuous.*

object Process:
given [ChunkType, CommandType <: Label, ResultType](using writable: ji.OutputStream is Writable by ChunkType)
given [ChunkType, CommandType <: Label, ResultType]
(using ji.OutputStream is Writable by ChunkType)
=> Process[CommandType, ResultType] is Appendable by ChunkType as appendable =

(process, stream) => process.stdin(stream)

given [CommandType <: Label, ResultType](using streamCut: Tactic[StreamError]) => Process[CommandType, ResultType] is Appendable by Text as appendableText =
given [CommandType <: Label, ResultType](using Tactic[StreamError])
=> Process[CommandType, ResultType] is Appendable by Text as appendableText =
(process, stream) => process.stdin(stream.map(_.sysBytes))

class Process[+ExecType <: Label, ResultType](process: java.lang.Process) extends ProcessRef:
Expand All @@ -50,7 +52,8 @@ class Process[+ExecType <: Label, ResultType](process: java.lang.Process) extend
def stderr(): LazyList[Bytes] raises StreamError =
Readable.inputStream.stream(process.getErrorStream.nn)

def stdin[ChunkType](stream: LazyList[ChunkType])(using writable: ji.OutputStream is Writable by ChunkType)
def stdin[ChunkType](stream: LazyList[ChunkType])
(using writable: ji.OutputStream is Writable by ChunkType)
: Unit =

writable.write(process.getOutputStream.nn, stream)
Expand Down
2 changes: 1 addition & 1 deletion src/core/guillotine.Sh.scala
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import gossamer.*
import rudiments.*
import spectacular.*

import exceptionDiagnostics.empty
import errorDiagnostics.empty

object Sh:
enum Context:
Expand Down

0 comments on commit 78bff97

Please sign in to comment.