mirror of
https://github.com/vale981/tridactyl
synced 2025-03-06 01:51:40 -05:00
27 lines
598 B
Bash
Executable file
27 lines
598 B
Bash
Executable file
#!/bin/bash
|
|
|
|
cachedJS() {
|
|
git diff --cached --name-only --diff-filter=ACM "*.js" "*.jsx" "*.ts" "*.tsx" "*.md" "*.css" | tr '\n' ' '
|
|
}
|
|
|
|
staged() {
|
|
git show :"$1"
|
|
}
|
|
|
|
ugly() {
|
|
local acc=()
|
|
for jsfile in "$@"; do
|
|
diff <(staged $jsfile) <(staged $jsfile | $(npm bin)/prettier --stdin-filepath $jsfile) >/dev/null || acc+=("$jsfile")
|
|
done
|
|
echo ${acc[@]}
|
|
}
|
|
|
|
noisy() {
|
|
local acc=()
|
|
for jsfile in "$@"; do
|
|
if [ "$(git diff --cached "$jsfile" | grep '^+.*console.log' -c)" -gt '0' ] ; then
|
|
acc+=("jsfile")
|
|
fi
|
|
done
|
|
echo ${acc[@]}
|
|
}
|