Skip to main content

detect_interpreter

Function detect_interpreter 

Source
pub fn detect_interpreter(path: &Path) -> Vec<String>
Expand description

Detect the interpreter for a script based on file extension.

Returns the argv prefix to spawn the appropriate interpreter for a script at path:

  • .py["python3"]
  • .sh["sh"]
  • any other extension (or none) → ["sh"] (default to shell)

Public so downstream consumers (e.g. i-phi’s hook dispatcher) can adopt the same script-extension dispatch table phi-core uses internally for ScriptCallback, rather than re-deriving it.