mermaid/scripts/editor.bash

28 lines
547 B
Bash
Raw Normal View History

#!/usr/bin/env bash
set -euxo pipefail
# We have to use npm instead of yarn because it causes trouble in netlify
# Link local mermaid to npm
pushd packages/mermaid
npm link
popd
2023-08-25 09:15:21 +05:30
# Clone or update the Mermaid Live Editor repository
if [ ! -d "mermaid-live-editor" ]; then
git clone --single-branch https://github.com/mermaid-js/mermaid-live-editor.git
cd mermaid-live-editor
else
cd mermaid-live-editor
git pull
fi
# Link local mermaid to live editor
npm link mermaid
# Install dependencies
npm install
# Build the site
npm run build