#!/usr/bin/env bash RUN="docker compose run --rm" ansi() { echo -e "\e[${1}m${*:2}\e[0m"; } bold() { ansi 1 "$@"; } # italic() { ansi 3 "$@"; } underline() { ansi 4 "$@"; } # strikethrough() { ansi 9 "$@"; } red() { ansi 31 "$@"; } name=$(basename $0) command=$1 args=${@:2} case $command in build) docker compose build $args ;; sh) $RUN mermaid sh ;; pnpm) $RUN mermaid sh -c "pnpm $args" ;; dev) $RUN --service-ports mermaid sh -c "pnpm run dev" ;; docs:dev) $RUN --service-ports mermaid sh -c "pnpm run --filter mermaid docs:dev:docker" ;; cypress) $RUN cypress $args ;; help|"") # Alignment of help message must be as it is, it will be nice looking when printed usage=$( cat <&2 $0 help exit 1 ;; esac