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.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for OroScript<'a>
impl<'a> !RefUnwindSafe for OroScript<'a>
impl<'a> Send for OroScript<'a>
impl<'a> Sync for OroScript<'a>
impl<'a> Unpin for OroScript<'a>
impl<'a> !UnwindSafe for OroScript<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more