@@ -9,8 +9,7 @@ if [ -z "$IMAGETAG" ]; then
99 echo " No image tag provided, building Docker image..."
1010 # Get the current package version from package.json
1111 VERSION=$( node -p " require('./package.json').version" )
12- IMAGETAG=" mermaid-cli:test"
13- docker build --build-arg VERSION=$VERSION -t $IMAGETAG .
12+ docker build --build-arg VERSION=$VERSION -t " mermaid-cli:test" -f DockerfileBuild .
1413fi
1514
1615# we must set `useMaxWidth: false` in config` to convert-svg-to-png for Percy CI
@@ -74,26 +73,25 @@ if grep -q "<br>" "./test-positive/graph-with-br.mmd.svg"; then
7473 exit 1;
7574fi
7675
77- # Test if --artefacts works correctly
78- # Create the artefact directory
79- mkdir -p $INPUT_DATA /static
76+ mkdir ./test-output/
8077
8178# Run mmdc with --artefacts using existing test file
8279docker run --rm -v $( pwd) :/data $IMAGETAG \
8380 -i /data/test-positive/mermaid.md \
84- --artefacts /data/$INPUT_DATA /static
81+ -o /data/test-output/mermaid-artefacts.md \
82+ --artefacts /data/static-out/
8583
8684# Verify that the images were created in the specified path
87- if [ ! -f " $INPUT_DATA /static/mermaid-1.png " ]; then
85+ if [ ! -f " . /static-out /mermaid-artefacts-1.svg " ]; then
8886 echo " Images were not created in the specified artefact path" ;
8987 exit 1;
9088fi
9189
9290# Verify that the generated markdown file contains the correct image links
93- if ! grep -q " " " $INPUT_DATA /static /mermaid.md" ; then
91+ if ! grep -q " !\[diagram\](\.\/\.\.\/ static-out\ /mermaid-artefacts-1\.svg )" " ./test-output /mermaid-artefacts .md" ; then
9492 echo " Generated markdown file does not contain the correct image links" ;
9593 exit 1;
9694fi
9795
9896# Clean up
99- rm -rf $INPUT_DATA /static
97+ rm -rf . /static-out/
0 commit comments