Skip to content

Commit 2be1d68

Browse files
committed
Update readme_toc.sh
1 parent 7141c8f commit 2be1d68

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

script/readme_toc.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
#! /bin/bash
22
set -euo pipefail
3-
cd "$(dirname "$0")"
4-
markdown-toc -i ../README.md
3+
4+
if ! which markdown-toc >/dev/null 2>&1; then
5+
echo "error: markdown-toc not found in PATH" >&2
6+
echo "you can install it using 'npm install --save markdown-toc'" >&2
7+
fi
8+
9+
cd "$(dirname "$0")"/..
10+
11+
cmd="markdown-toc -i README.md"
12+
echo "running $cmd"
13+
$cmd
14+
echo "done"

0 commit comments

Comments
 (0)