Skip to content

Latest commit

 

History

History
49 lines (40 loc) · 1.99 KB

File metadata and controls

49 lines (40 loc) · 1.99 KB

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Repository Overview

This is an asdf plugin for Task (go-task/task), a task runner/build tool. The plugin follows asdf plugin conventions to manage Task installations.

Architecture

The plugin consists of three main components:

  1. bin/ - Entry points for asdf operations (list-all, download, install, latest-stable)
  2. lib/utils.bash - Core functionality shared across scripts including GitHub API interactions, version management, and platform detection
  3. scripts/ - Development tools for linting and formatting

Key architectural patterns:

  • All bin scripts source lib/utils.bash for shared functionality
  • Downloads are fetched from GitHub releases at go-task/task
  • Platform detection handles Linux/macOS and various architectures (amd64, arm64, 386, arm)
  • Version tags are fetched directly from GitHub and stripped of 'v' prefix

Development Commands

Testing

# Test the plugin locally
asdf plugin test task https://github.com/sgaunet/asdf-task "task --version"

Linting

# Run shellcheck and shfmt checks
./scripts/lint.bash

Formatting

# Auto-format bash scripts
./scripts/format.bash

Key Implementation Details

  • The plugin only supports version installs (not ref or path installs)
  • Downloads are extracted to a temporary directory first, then only the task binary is moved to the install path
  • GitHub API token can be provided via GITHUB_API_TOKEN environment variable for rate limiting
  • Version sorting handles semantic versioning with special characters
  • Comprehensive error handling with retry logic for network operations
  • Checksum verification for downloaded files when available
  • Debug mode available via ASDF_TASK_DEBUG=1 for troubleshooting
  • Optional scripts provide environment setup (exec-env) and help documentation
  • Support for multiple platforms including Linux, macOS, Windows (WSL), and BSD variants