Expand description
Platform-specific utilities and cross-platform compatibility helpers
This module provides abstractions over platform differences to ensure AGPM works consistently across Windows, macOS, and Linux.
Functionsยง
- command_
exists - Checks if a command is available in the system PATH.
- compute_
relative_ install_ path - Computes the relative install path by removing redundant directory prefixes.
- get_
cache_ dir - Returns the platform-specific cache directory for AGPM.
- get_
data_ dir - Returns the platform-specific data directory for AGPM.
- get_
git_ command - Returns the appropriate Git command name for the current platform.
- get_
home_ dir - Gets the home directory path for the current user.
- get_
shell_ command - Returns the appropriate shell command and flag for the current platform.
- is_
windows - Checks if the current platform is Windows.
- normalize_
path_ for_ storage - Normalizes a path for cross-platform storage by converting all separators to forward slashes.
- normalize_
path_ separator - Converts a path to use the correct separator for the current platform.
- path_
to_ os_ str - Returns a path as an
OsStrfor use in command arguments. - path_
to_ string - Safely converts a path to a string, handling non-UTF-8 paths gracefully.
- paths_
equal - Compares two paths for equality, respecting platform case sensitivity rules.
- resolve_
path - Resolves a path with tilde expansion and environment variable substitution.
- safe_
canonicalize - Canonicalizes a path with proper cross-platform handling.
- safe_
join - Safely joins a base path with a relative path, preventing directory traversal.
- validate_
path_ chars - Validates that a path contains only characters valid for the current platform.
- windows_
long_ path - No-op implementation of
windows_long_pathfor non-Windows platforms.