erplibre/script/maintenance/black.sh

14 lines
343 B
Bash
Raw Permalink Normal View History

#!/usr/bin/env bash
Red='\033[0;31m' # Red
Color_Off='\033[0m' # Text Reset
# This will format all python file
# argument 1: directory or file to format
source ./.venv.erplibre/bin/activate
2023-12-02 14:09:09 -05:00
black -l 79 --preview -t py37 "$@"
2021-06-27 00:22:22 -04:00
retVal=$?
if [[ $retVal -ne 0 ]]; then
echo -e "${Red}Error${Color_Off} black format"
2021-06-27 00:22:22 -04:00
exit 1
fi