2023-08-25 00:12:14 +05:30
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2023-08-25 08:22:24 +05:30
|
|
|
set -euxo pipefail
|
2023-08-25 00:12:14 +05:30
|
|
|
# We have to use npm instead of yarn because it causes trouble in netlify
|
|
|
|
|
|
|
|
# Link local mermaid to npm
|
2023-08-25 08:22:24 +05:30
|
|
|
pushd packages/mermaid
|
2023-08-25 00:12:14 +05:30
|
|
|
npm link
|
2023-08-25 08:22:24 +05:30
|
|
|
popd
|
2023-08-25 00:12:14 +05:30
|
|
|
|
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
|
2023-08-25 00:12:14 +05:30
|
|
|
|
|
|
|
# Link local mermaid to live editor
|
|
|
|
npm link mermaid
|
|
|
|
|
|
|
|
# Install dependencies
|
|
|
|
npm install
|
|
|
|
|
|
|
|
# Build the site
|
|
|
|
npm run build
|