1use crate::{App, CoreError};
4
5impl App {
6 pub fn home_dir(&self) -> String {
8 self.home().display().to_string()
9 }
10
11 pub fn cd_path(&self, plugin_name: &str) -> Result<String, CoreError> {
13 let current = self
14 .current_tool(plugin_name)?
15 .ok_or_else(|| CoreError::InactiveTool(plugin_name.to_string()))?;
16 Ok(self.effective_runtime_dir(¤t).display().to_string())
17 }
18
19 pub fn plugin_dir(&self, plugin_name: &str) -> Result<String, CoreError> {
21 let entry = self.resolve_registry_entry(plugin_name)?;
22 let entry = self.materialize_plugin_entry(&entry)?;
23 Ok(self
24 .normalize_source_path(&entry.source)
25 .display()
26 .to_string())
27 }
28}