Properly print warnings to stderr. Also, use : instead of 'echo' as a
fallback as the latter spits out garbage to stdout.
Examples without pep8 installed.
Before:
$ ./hooks/pre-commit
./hooks/pre-commit: line 97: WARNING:: command not found
ERROR: pep8 tests failed!
After:
$ ./hooks/pre-commit
WARNING: pep8 is not installed, using dummy placeholder!
PEP8_IGNORE="E123,E501,W503"
err() {
PEP8_IGNORE="E123,E501,W503"
err() {
fi
done
warn "$1 is not installed, using dummy placeholder!"
fi
done
warn "$1 is not installed, using dummy placeholder!"
}
PYFLAKES=$(find_command pyflakes)
}
PYFLAKES=$(find_command pyflakes)