Skip to main content

Module utils

Module utils 

Source

Functions§

ask_for_confirmation
build_blocking_http_client
check_license
command_exists
confirm_untrusted_source
copy_dir_all
expand_placeholders
expand_tilde
format_bytes
format_size_diff
generate_package_id
Generates a unique, origin-aware ID for a package.
generate_versioned_package_id
Generates a unique ID for a package including its version.
get_all_available_package_managers
Scans the system for all supported package managers.
get_cpu_info
get_current_shell
get_db_base_dir
get_db_root
Returns the root directory for the package database.
get_desktop_environment
get_display_server
get_distro_version
get_git_base_dir
get_gpu_info
get_http_client
Creates an HTTP client with Zoi’s default configuration.
get_init_system
get_kernel_version
get_linux_distribution
get_linux_distribution_info
get_linux_distro_family
Detects the general family of a Linux distribution (e.g. “debian”, “arch”, “fedora”).
get_native_package_manager
Identifies the primary package manager for the current operating system.
get_package_dir_name
Creates the directory name for the package in the store. Format: {hash}-{name}
get_platform
Returns a standard Zoi platform identifier (e.g. “linux-amd64”, “windows-arm64”).
get_privilege_escalator
get_store_base_dir
Returns the root directory of the package store for a given scope.
get_user_home
Returns the home directory of the current user, or the original user if run via sudo or doas.
is_admin
is_mini_mode
is_platform_compatible
is_safe_path
Verifies that a given path is “Safe” and doesn’t attempt to escape the base directory.
is_zoios
Returns true if the current system is a ZoiOS-based distribution (like Parlex).
resolve_fallback_scope
Resolves the default installation scope based on the current environment.
retry_backoff_sleep
Performs a jittered exponential backoff sleep.
run_shell_command
run_shell_command_quietly
set_path_owner
set_path_read_only
set_path_writable
symlink_dir
symlink_file