21 lines
994 B
Bash
Executable File
21 lines
994 B
Bash
Executable File
# common.sh — shared helpers for Keru scripts (installer, iso, kama)
|
|
PREFIX="\033[1;35m[ keru ]\033[0m"
|
|
msg() { printf '%b %s\n' "$PREFIX" "$*"; }
|
|
info() { printf '%b \033[1;34m==>\033[0m %s\n' "$PREFIX" "$*"; }
|
|
warn() { printf '%b \033[1;33mwarning:\033[0m %s\n' "$PREFIX" "$*"; }
|
|
die() { printf '%b \033[1;31merror:\033[0m %s\n' "$PREFIX" "$*" >&2; exit 1; }
|
|
|
|
banner() { printf '\033[1;36m%s\033[0m\n' "------------------------------------------"; printf '\033[1;36m %s\033[0m\n' "$*"; printf '\033[1;36m%s\033[0m\n' "------------------------------------------"; }
|
|
|
|
have() { command -v "$1" >/dev/null 2>&1; }
|
|
|
|
# KeruOS source root (this repo)
|
|
KERU_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
|
|
# Sibling repos (clone next to this one by default)
|
|
# kama -> the package manager
|
|
# kama-packages -> the recipe repository
|
|
# Override with env if you keep them somewhere else.
|
|
KAMA_DIR="${KAMA_DIR:-$(dirname "$KERU_ROOT")/kama}"
|
|
PKGS_DIR="${PKGS_DIR:-$(dirname "$KERU_ROOT")/kama-packages}"
|