mermaid/scripts/editor.bash

31 lines
677 B
Bash
Raw Normal View History

#!/usr/bin/env bash
set -euxo pipefail
2023-09-22 07:10:42 +02:00
pushd packages/mermaid
# Append commit hash to version
jq ".version = .version + \"+${COMMIT_REF:0:7}\"" package.json > package.tmp.json
mv package.tmp.json package.json
popd
2023-09-22 07:17:06 +02:00
pnpm run -r clean
pnpm build:types
pnpm build:mermaid
2023-09-22 06:55:42 +02:00
# Clone the Mermaid Live Editor repository
rm -rf mermaid-live-editor
git clone --single-branch https://github.com/mermaid-js/mermaid-live-editor.git
cd mermaid-live-editor
# We have to use npm instead of yarn because it causes trouble in netlify
# Install dependencies
npm install
# Link local mermaid to live editor
npm link ../packages/mermaid
# Force Build the site
npm run build -- --force