Skip to main content

resolve_cwd

Function resolve_cwd 

Source
pub fn resolve_cwd(
    cwd: Option<&str>,
    plugin_root: &Path,
    plugin_data: &Path,
) -> Result<PathBuf, PluginError>
Expand description

Resolve an explicit or default cwd after placeholder expansion and enforce post-resolution containment.

  • None → canonical plugin root (spec default).
  • ./... or ${PLUGIN_ROOT}[/...] → must stay within the canonical plugin root.
  • ${PLUGIN_DATA}[/...] → must stay within the canonical plugin data dir.