Skip to content
This repository has been archived by the owner on Jan 3, 2025. It is now read-only.

scripts: add a script to run markdownlint check locally #74

Merged
merged 1 commit into from
May 18, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions scripts/markdownlint
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

cd "$(dirname "$0")/.."

if ! program=$(which markdownlint) &>/dev/null ; then
program=./node_modules/.bin/markdownlint
if ! test -f ./node_modules/.bin/markdownlint; then
had_lock=
if test -f package-json.lock ; then
had_lock=true
fi
npm install --save-dev 'markdownlint-cli@0.17.0'
if [[ -z "$had_lock" ]] ; then
rm -f package-lock.json
fi
fi
fi

exec node "$program" "$@"