package ops
- Alphabetic
- By Inheritance
- ops
- Extensions
- FilterMapExtConv
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- type BasePath = os.BasePath
- class Bytes extends AnyRef
Trivial wrapper around
Array[Byte]
with sane equality and useful toString - class Callable1[T1, R] extends (T1) => R
Provides
a.! b
as an alternative to thea(b)
syntax for calling a function with one argument - class Callable2[T1, T2, R] extends (T1, T2) => R
Provides
a! b
as an alternative to the(a(b, _)
syntax for partially applying a function with two arguments - case class Command[T](cmd: Vector[String], envArgs: Map[String, String], execute: (Path, Command[_]) => T) extends Dynamic with Product with Serializable
A staged sub-process command that has yet to be executed.
- case class CommandResult(exitCode: Int, chunks: Seq[Either[Bytes, Bytes]]) extends Product with Serializable
Contains the accumulated output for the invocation of a subprocess command.
Contains the accumulated output for the invocation of a subprocess command.
Apart from the exit code, the primary data-structure is a sequence of byte chunks, tagged with Left for stdout and Right for stderr. This is interleaved roughly in the order it was emitted by the subprocess, and reflects what a user would have see if the subprocess was run manually.
Derived from that, is the aggregate
out
anderr
StreamValues, wrapping stdout/stderr respectively, and providing convenient access to the aggregate output of each stream, as bytes or strings or lines. - trait CopyMove extends (Path, Path) => Unit
- trait Extensions extends FilterMapExtConv
- implicit class iterShow[T] extends AnyRef
- Definition Classes
- Extensions
- type FilePath = os.FilePath
- type FileType = os.FileType
- class FilterMapExt[+T, Repr] extends AnyRef
Extends collections to give short aliases for the commonly used operations, so we can make it easy to use from the command line.
- class FilterMapExt2[+T] extends AnyRef
Extends collections to give short aliases for the commonly used operations, so we can make it easy to use from the command line.
- trait FilterMapExtConv extends AnyRef
- class FilterMapExtGen[+T] extends AnyRef
Extends collections to give short aliases for the commonly used operations, so we can make it easy to use from the command line.
- case class InteractiveShelloutException() extends Exception with Product with Serializable
- case class LsSeq(base: Path, listed: RelPath*) extends Seq[Path] with Product with Serializable
A specialized Seq[Path] used to provide better a better pretty-printed experience
- type Path = os.Path
- type PermSet = os.PermSet
- class Pipeable[T] extends AnyRef
Lets you pipe values through functions
- class RegexContext extends AnyRef
Lets you pattern match strings with interpolated glob-variables
- type RelPath = os.RelPath
- type ResourceNotFoundException = os.ResourceNotFoundException
- type ResourceRoot = os.ResourceRoot
- case class Shellable(s: Seq[String]) extends Product with Serializable
An implicit wrapper defining the things that can be "interpolated" directly into a subprocess call.
- case class ShelloutException(result: CommandResult) extends Exception with Product with Serializable
Thrown when a shellout command results in a non-zero exit code.
Thrown when a shellout command results in a non-zero exit code.
Doesn't contain any additional information apart from the CommandResult that is normally returned, but ensures that failures in subprocesses happen loudly and won't get ignored unless intentionally caught
- case class StreamValue(chunks: Seq[Bytes]) extends Product with Serializable
Encapsulates one of the output streams from a subprocess and provides convenience methods for accessing it in a variety of forms
- trait StreamableOp1[T1, R, C <: Seq[R]] extends (T1) => C
An Callable1 that returns a Seq[R], but can also do so lazily (Iterator[R]) via
op.iter! arg
.An Callable1 that returns a Seq[R], but can also do so lazily (Iterator[R]) via
op.iter! arg
. You can then use the iterator however you wish - case class kill(signal: Int)(implicit wd: Path) extends (Int) => CommandResult with Product with Serializable
Kills the given process with the given signal, e.g.
Kills the given process with the given signal, e.g.
kill(9)! pid
Value Members
- val %: Command[Unit]
Used to spawn a subprocess interactively; any output gets printed to the console and any input gets requested from the current console.
Used to spawn a subprocess interactively; any output gets printed to the console and any input gets requested from the current console. Can be used to run interactive subprocesses like
%vim
,%python
,%ssh "www.google.com"
or%sbt
. - val %%: Command[CommandResult]
Spawns a subprocess non-interactively, waiting for it to complete and collecting all output into a CommandResult which exposes it in a convenient form.
Spawns a subprocess non-interactively, waiting for it to complete and collecting all output into a CommandResult which exposes it in a convenient form. Call via
%%('whoami).out.trim
or%%('git, 'commit, "-am", "Hello!").exitCode
- val /: os./.type
Extractor to let you easily pattern match on ops.Paths.
Extractor to let you easily pattern match on ops.Paths. Lets you do
@ val base/segment/filename = pwd base: Path = Path(Vector("Users", "haoyi", "Dropbox (Personal)")) segment: String = "Workspace" filename: String = "Ammonite"
To break apart a path and extract various pieces of it.
- val BasePath: os.BasePath.type
- implicit def Callable1Implicit[T1, R](f: (T1) => R): Callable1[T1, R]
- Definition Classes
- Extensions
- val FilePath: os.FilePath.type
- val FileType: os.FileType.type
- implicit def FilterMapArraysImplicit[T](a: Array[T])(implicit arg0: ClassTag[T]): FilterMapExt[T, Array[T]]
Lets you call FilterMapExt aliases on Arrays too
Lets you call FilterMapExt aliases on Arrays too
- Definition Classes
- FilterMapExtConv
- implicit def FilterMapExtImplicit[Repr](repr: Repr)(implicit i: IsIterable[Repr]): FilterMapExt[scala.collection.generic.IsIterable.A, Repr]
- Definition Classes
- FilterMapExtConv
- implicit def FilterMapGeneratorsImplicit[T](a: Generator[T]): FilterMapExtGen[T]
- Definition Classes
- Extensions
- implicit def FilterMapIteratorsImplicit[T](a: Iterator[T]): FilterMapExt2[T]
- Definition Classes
- Extensions
- val Path: os.Path.type
- val PathError: os.PathError.type
- val PermSet: os.PermSet.type
- implicit def PipeableImplicit[T](t: T): Pipeable[T]
- Definition Classes
- Extensions
- implicit def RegexContextMaker(s: StringContext): RegexContext
- Definition Classes
- Extensions
- val RelPath: os.RelPath.type
- val ResourceNotFoundException: os.ResourceNotFoundException.type
- val ResourceRoot: os.ResourceRoot.type
- implicit def SeqFactoryFunc[T, CC[X] <: Seq[X] with SeqOps[X, CC, CC[X]]](s: SeqFactory[CC]): (Seq[T]) => CC[T]
Allows you to pipe sequences into other sequences to convert them, e.g.
Allows you to pipe sequences into other sequences to convert them, e.g. Seq(1, 2, 3) |> Vector
- Definition Classes
- FilterMapExtConv
- implicit def StringPath(s: String): RelPath
- implicit def SymPath(s: Symbol): RelPath
- val empty: os.RelPath
- val exists: os.exists.type
- val home: os.Path
The user's home directory
- val mkdir: all.type
- implicit def posixFileData(p: Path): PosixStatInfo
- implicit val postfixOps: postfixOps
- val pwd: os.Path
The current working directory for this process.
- val read: os.read.type
- def resource(implicit resRoot: ResourceRoot = Thread.currentThread().getContextClassLoader): ResourcePath
- val rm: all.type
- val root: os.Path
The root of the filesystem
- implicit def statFileData(p: Path): StatInfo
Lets you treat any path as a file, letting you access any property you'd normally access through stat-ing it by stat-ing the file for you when necessary.
- val tmp: temp.type
- val up: os.RelPath
- val write: os.write.type
- object Extensions extends Extensions
- object ImplicitWd
If you want to call subprocesses using % or %% and don't care what working directory they use, import this via
- object Internals
- object LsSeq extends Serializable
- object RegexContext
- object Shellable extends Serializable
- object Shellout
Internal utilities to support spawning subprocesses
- object cp extends (Path, Path) => Unit with CopyMove
Copies a file or folder from one place to another.
Copies a file or folder from one place to another. Creates any necessary directories, and copies folders recursively.
- object ln extends (Path, Path) => Unit
- object ls extends (Path) => LsSeq
- object mv extends (Path, Path) => Unit with Mover with CopyMove
Moves a file or folder from one place to another.
Moves a file or folder from one place to another.
Creates any necessary directories
- object stat extends (Path) => StatInfo