pub fn get_flatten_behavior(
manifest: &Manifest,
dep: &ResourceDependency,
artifact_type: &str,
resource_type: ResourceType,
) -> boolExpand description
Determines the flatten behavior for a resource installation.
Flatten behavior controls whether directory structure from the source repository is preserved in the installation path. The decision is made by checking:
- Explicit
flattensetting on the dependency (highest priority) - Tool configuration default for this resource type
- Global default (false)
§Arguments
manifest- The project manifest containing tool configurationsdep- The resource dependency specificationartifact_type- The tool name (e.g., “claude-code”, “opencode”)resource_type- The resource type (Agent, Command, etc.)
§Returns
true if directory structure should be flattened, false if it should be preserved.
§Examples
use agpm_cli::core::ResourceType;
use agpm_cli::manifest::Manifest;
use agpm_cli::resolver::path_resolver::get_flatten_behavior;
let manifest = Manifest::new();
let flatten = get_flatten_behavior(&manifest, &dep, "claude-code", ResourceType::Agent);