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