2022-06-18 21:56:31 -07:00
|
|
|
use super::*;
|
2019-07-13 01:55:06 -07:00
|
|
|
|
2019-09-21 15:35:03 -07:00
|
|
|
pub(crate) trait PlatformInterface {
|
2020-02-14 04:49:25 -08:00
|
|
|
/// Construct a command equivalent to running the script at `path` with the
|
|
|
|
/// shebang line `shebang`
|
2019-07-13 01:55:06 -07:00
|
|
|
fn make_shebang_command(
|
|
|
|
path: &Path,
|
2022-11-02 23:37:35 -07:00
|
|
|
working_directory: Option<&Path>,
|
2021-05-17 20:44:12 -07:00
|
|
|
shebang: Shebang,
|
2019-07-13 01:55:06 -07:00
|
|
|
) -> Result<Command, OutputError>;
|
|
|
|
|
|
|
|
/// Set the execute permission on the file pointed to by `path`
|
|
|
|
fn set_execute_permission(path: &Path) -> Result<(), io::Error>;
|
|
|
|
|
2020-02-14 04:49:25 -08:00
|
|
|
/// Extract the signal from a process exit status, if it was terminated by a
|
|
|
|
/// signal
|
2019-07-13 01:55:06 -07:00
|
|
|
fn signal_from_exit_status(exit_status: process::ExitStatus) -> Option<i32>;
|
|
|
|
|
2020-02-14 04:49:25 -08:00
|
|
|
/// Translate a path from a "native" path to a path the interpreter expects
|
2021-02-15 01:18:31 -08:00
|
|
|
fn convert_native_path(working_directory: &Path, path: &Path) -> Result<String, String>;
|
2019-07-13 01:55:06 -07:00
|
|
|
}
|