Skip to main content

Module cache

Module cache 

Source
Expand description

Cache directory management for git repositories.

Provides a Cargo-like caching structure:

~/.skilo/
├── config.toml
└── git/
    ├── checkouts/    # Working trees at specific commits
    └── db/           # Bare git repositories (fetch targets)

Structs§

CacheStats
Get cache statistics.
CachedCheckout
Information about a checkout in checkouts/.
CachedRepo
Information about a cached repository in db/.

Functions§

checkout_name
Generate checkout directory name for a repo at a specific revision.
checkouts_dir
Get the checkouts directory (~/.skilo/git/checkouts/).
clean_all
Clean all cache (db + checkouts).
clean_old_checkouts
Clean checkouts older than the given age in days.
db_dir
Get the bare repositories directory (~/.skilo/git/db/).
db_name
Generate db directory name for a repo.
ensure_dir
Ensure a directory exists, creating it if necessary.
format_size
Format bytes as human-readable string.
git_dir
Get the git cache directory.
is_offline
Check if offline mode is enabled via SKILO_OFFLINE environment variable.
parse_owner_repo
Parse owner and repo from a git URL.
skilo_home
Get the skilo home directory.