Last active
December 25, 2020 03:45
-
-
Save aiya000/9aa5f5ee2ec43ef2de7b641ab7473c33 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
root_dir=$(git rev-parse --show-toplevel) | |
remote_latest_branch=$(bash -c "$root_dir/scripts/get-root-branch.sh") | |
current_branch=$(git branch --show-current) | |
unpushed_files=$(git diff --stat "$remote_latest_branch..$current_branch" --name-only) | |
# Example usage: textlint for markdown | |
unpushed_markdown_files=$(echo "$unpushed_files" | grep '\.md$') | |
if ! npx textlint --config "$root_dir/.textlintrc" "$unpushed_markdown_files" ; then | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment