Struct oro_script::OroScript
source · pub struct OroScript<'a> { /* private fields */ }
Implementations§
source§impl<'a> OroScript<'a>
impl<'a> OroScript<'a>
pub fn new( package_path: impl AsRef<Path>, event: impl AsRef<str> ) -> Result<Self, OroScriptError>
sourcepub fn workspace_path(self, path: impl AsRef<Path>) -> Self
pub fn workspace_path(self, path: impl AsRef<Path>) -> Self
If specified, node_modules/.bin
directories above this path will not
be added to the $PATH variable when running the script.
sourcepub fn env(self, key: impl AsRef<OsStr>, value: impl AsRef<OsStr>) -> Self
pub fn env(self, key: impl AsRef<OsStr>, value: impl AsRef<OsStr>) -> Self
Set an environment variable.
sourcepub fn stdout(self, stdout: impl Into<Stdio>) -> Self
pub fn stdout(self, stdout: impl Into<Stdio>) -> Self
Set the Stdio
that the script will use as its
standard output stream.
sourcepub fn stderr(self, stderr: impl Into<Stdio>) -> Self
pub fn stderr(self, stderr: impl Into<Stdio>) -> Self
Set the Stdio
that the script will use as its
standard error stream.
sourcepub fn stdin(self, stdin: impl Into<Stdio>) -> Self
pub fn stdin(self, stdin: impl Into<Stdio>) -> Self
Set the Stdio
that the script will use as its
standard input stream.
NOTE: This defaults to Stdio::null
, which is
appropriate when running lifecycle scripts, but regular run-scripts
and such cases can use Stdio::inherit
.
sourcepub fn output(self) -> Result<Output, OroScriptError>
pub fn output(self) -> Result<Output, OroScriptError>
Execute script, collecting all its output.
sourcepub fn spawn(self) -> Result<ScriptChild, OroScriptError>
pub fn spawn(self) -> Result<ScriptChild, OroScriptError>
Spawn script as a child process.