Skip to content

Commit

Permalink
build: use /bin/sh instead of /bin/bash for shell
Browse files Browse the repository at this point in the history
Running docker/build-push-action@v3 failed, as Alpine Linux
does not have /bin/bash, only /bin/sh,
see: https://github.com/aloisklink/mermaid-cli/runs/6854319356

This also changes the BASH only [[ "$OUTPUT" == "$EXPECTED_OUTPUT" ]]
in `run-tests.sh` into `[ "$OUTPUT" = "$EXPECTED_OUTPUT" ]`, which
should work in all POSIX shells.
  • Loading branch information
aloisklink authored and MindaugasLaganeckas committed Aug 22, 2022
1 parent acc8083 commit 004d850
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion copy_modules.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
cp ./node_modules/mermaid/dist/mermaid.min.js .

mkdir -p fontawesome/css/
Expand Down
2 changes: 1 addition & 1 deletion install-dependencies.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh

# Install chromium and required fonts
# available fonts https://wiki.alpinelinux.org/wiki/Fonts
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
},
"exports": "./src/index.js",
"scripts": {
"upgrade": "yarn-upgrade-all && bash copy_modules.sh",
"prepare": "bash copy_modules.sh",
"prepack": "bash copy_modules.sh",
"upgrade": "yarn-upgrade-all && sh copy_modules.sh",
"prepare": "sh copy_modules.sh",
"prepack": "sh copy_modules.sh",
"test": "standard && yarn node --experimental-vm-modules $(yarn bin jest)",
"lint": "standard",
"lint-fix": "standard --fix"
Expand Down
4 changes: 2 additions & 2 deletions run-tests.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
INPUT_DATA=$1
IMAGETAG=$2

Expand Down Expand Up @@ -33,7 +33,7 @@ cat $INPUT_DATA/flowchart1.mmd | docker run --rm -i -v $(pwd):/data $IMAGETAG -o
# Test if mmdc crashes on Markdown files containing no mermaid charts
OUTPUT=$(docker run --rm -v $(pwd):/data $IMAGETAG -i /data/test-positive/no-charts.md)
EXPECTED_OUTPUT="No mermaid charts found in Markdown input"
[[ "$OUTPUT" == "$EXPECTED_OUTPUT" ]] || echo "Expected output to be '$EXPECTED_OUTPUT', got '$OUTPUT'"
[ "$OUTPUT" = "$EXPECTED_OUTPUT" ] || echo "Expected output to be '$EXPECTED_OUTPUT', got '$OUTPUT'"

# Test if mmdc does not replace <br> with <br/>
docker run --rm -v $(pwd):/data $IMAGETAG -i /data/test-positive/graph-with-br.mmd -w 800;
Expand Down

0 comments on commit 004d850

Please sign in to comment.