just/src/platform_interface.rs
Casey Rodarmor 74e45e7c05
Remove dependency on brev (#462)
Just's dependency on brev was the cause of a
fairly deep branch of the transitive dependency
tree. To decrease build time and make the life of
packagers easier, this diff moves the functionality
that Just was using in Brev into Just itself, and
removes the dependency on Brev.

Fortunately, the only functionality that Just was
using was the output function and OutputError
enum, so this was easily done.
2019-07-13 01:55:06 -07:00

21 lines
728 B
Rust

use crate::common::*;
pub trait PlatformInterface {
/// Construct a command equivalent to running the script at `path` with the
/// shebang line `shebang`
fn make_shebang_command(
path: &Path,
command: &str,
argument: Option<&str>,
) -> Result<Command, OutputError>;
/// Set the execute permission on the file pointed to by `path`
fn set_execute_permission(path: &Path) -> Result<(), io::Error>;
/// Extract the signal from a process exit status, if it was terminated by a signal
fn signal_from_exit_status(exit_status: process::ExitStatus) -> Option<i32>;
/// Translate a path from a "native" path to a path the interpreter expects
fn to_shell_path(path: &Path) -> Result<String, String>;
}