#!/bin/bash RUN="docker-compose run --rm" name=$(basename $0) command=$1 args=${@:2} case $command in sh) $RUN mermaid sh -c "npx $args" ;; pnpm) $RUN mermaid sh -c "npx $command $args" ;; dev) $RUN --service-ports mermaid sh -c "npx pnpm run dev" ;; docs:dev) $RUN --service-ports mermaid sh -c "cd packages/mermaid/src/docs && npx pnpm prefetch && npx vitepress --port 3333 --host" ;; help) # Alignment of help message must be as it is, it will be nice looking when printed usage=$( cat <', e.g.: # 'git diff --name-only develop | xargs run pnpm prettier --write' $name pnpm test # Run unit tests $name pnpm vitest # Run watcher for unit tests $name pnpm e2e # Run integration tests EOF ) echo -n -e "$usage" ;; *) $name help ;; esac