mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-07-06 15:57:50 +02:00
feat(shell): expand Command APIs (#526)
Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
This commit is contained in:
committed by
GitHub
parent
be591d2feb
commit
5b3210c224
@@ -13,6 +13,8 @@
|
||||
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
ffi::OsStr,
|
||||
path::Path,
|
||||
sync::{Arc, Mutex},
|
||||
};
|
||||
|
||||
@@ -45,7 +47,7 @@ pub struct Shell<R: Runtime> {
|
||||
|
||||
impl<R: Runtime> Shell<R> {
|
||||
/// Creates a new Command for launching the given program.
|
||||
pub fn command(&self, program: impl Into<String>) -> Command {
|
||||
pub fn command(&self, program: impl AsRef<OsStr>) -> Command {
|
||||
Command::new(program)
|
||||
}
|
||||
|
||||
@@ -53,7 +55,7 @@ impl<R: Runtime> Shell<R> {
|
||||
///
|
||||
/// A sidecar program is a embedded external binary in order to make your application work
|
||||
/// or to prevent users having to install additional dependencies (e.g. Node.js, Python, etc).
|
||||
pub fn sidecar(&self, program: impl Into<String>) -> Result<Command> {
|
||||
pub fn sidecar(&self, program: impl AsRef<Path>) -> Result<Command> {
|
||||
Command::new_sidecar(program)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user