Skip to content

Latest commit

 

History

History
281 lines (159 loc) · 3.96 KB

File metadata and controls

281 lines (159 loc) · 3.96 KB

Dependencies

This document lists the dependencies required for each module in the utilities library.

Core Requirements

All modules require:

  • bash 3.2+ (macOS default) or 4.0+
  • curl - For remote sourcing

Module Dependencies

Base Module

Platform: All

Required:

  • bash 3.2+
  • Standard Unix utilities: tput, ps, grep, sed

Optional:

  • None

System Module

Platform: All

Required:

  • bash 3.2+
  • uname, grep, sed, awk
  • readlink (for symlinks)

Optional:

  • sudo (for privileged operations)
  • jq (for JSON manipulation - auto-installed if needed)

Git Module

Platform: All

Required:

  • git

Optional:

  • None

Homebrew Module

Platform: macOS, Linux

Required:

  • curl

Optional:

  • Homebrew (checked/initialized by functions)
  • python3 (for brew.py script functionality)

Installation:


MacPorts Module

Platform: macOS only

Required:

  • MacPorts

Installation:


Gofish Module

Platform: All

Optional:

  • Gofish (can be installed via module functions)

Installation:


APT Module

Platform: Debian/Ubuntu Linux

Required:

  • apt-get
  • dpkg

Optional:

  • sudo (for privileged operations)

Python Module

Platform: All

Required (per sub-module):

  • pip.sh: python, pip
  • pip3.sh: python3, pip3
  • pyenv.sh: pyenv

Installation:


Node Module

Platform: All

Required:

  • node
  • npm

Optional:

  • npx (usually included with npm 5.2+)
  • yarn

Installation:


Ruby Module

Platform: All

Required:

  • ruby
  • gem

Installation:

  • macOS: Included by default
  • Linux: apt install ruby-full or equivalent

Rust Module

Platform: All

Required:

  • rust
  • cargo

Installation:


Go Module

Platform: All

Required:

  • go

Installation:


Java Module

Platform: All

Required:

  • SDKMAN

Installation:


Fish Module

Platform: All (requires Fish shell)

Required:

  • fish shell

Optional (per sub-module):

  • omf.sh: Oh My Fish
  • fisher.sh: Fisher plugin manager

Installation:


Conditional Loading

The main utilities.sh script automatically detects the platform and loads only relevant modules:

  • macOS (Darwin):

    • Loads: base, system, network, homebrew, macports, git, fish, npm, pip, pyenv, gem, cargo, go, sdkman, gofish
  • Debian/Ubuntu Linux:

    • Loads: base, system, network, apt, homebrew, git, fish, npm, pip, pyenv, gem, cargo, go, sdkman, gofish
  • Other Linux:

    • Loads: base, system, network, homebrew, git, fish, npm, pip, pyenv, gem, cargo, go, sdkman, gofish

Minimal Installation

For a minimal setup with just core utilities:

# Only bash and curl required
source /dev/stdin <<<"$(curl -s "https://raw.githubusercontent.com/dotbrains/utilities/v1.0.0/utilities.sh")"

# Base and system modules will always be available
if cmd_exists "git"; then
    # Git module functions available
fi

Checking Dependencies

Use the provided is_*_installed() functions to check for dependencies before use:

if is_brew_installed; then
    # Homebrew operations
fi

if is_npm_installed; then
    # npm operations
fi