From a08e8e9a7475bb9d2fe6e4a173a3bc42bceddd16 Mon Sep 17 00:00:00 2001 From: Sonny Date: Sat, 24 Aug 2019 19:19:38 +0200 Subject: [PATCH] Use user installed binaries --- pre-commit.d/autoflake.sh | 2 +- pre-commit.d/isort.sh | 2 +- pre-commit.d/prettier.sh | 2 +- pre-commit.d/yapf.sh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pre-commit.d/autoflake.sh b/pre-commit.d/autoflake.sh index 7e4ec3f..f28b018 100755 --- a/pre-commit.d/autoflake.sh +++ b/pre-commit.d/autoflake.sh @@ -3,7 +3,7 @@ FILES=$(git diff --cached --name-only --diff-filter=ACM "*.py" | sed 's| |\\ |g' if [ ! -z "$FILES" ]; then # Format all selected files - echo "$FILES" | xargs -I {} /bin/bash -c "/home/sonny/.local/bin/autoflake --in-place --remove-unused-variables {}" + echo "$FILES" | xargs -I {} /bin/bash -c "$HOME/.local/bin/autoflake --in-place --remove-unused-variables {}" if [ $? -ne 0 ]; then exit 1 diff --git a/pre-commit.d/isort.sh b/pre-commit.d/isort.sh index 09757c0..2553b36 100755 --- a/pre-commit.d/isort.sh +++ b/pre-commit.d/isort.sh @@ -3,7 +3,7 @@ FILES=$(git diff --cached --name-only --diff-filter=ACM "*.py" | sed 's| |\\ |g' if [ ! -z "$FILES" ]; then # Format all selected files - echo "$FILES" | xargs ./env/bin/isort + echo "$FILES" | xargs $HOME/.local/bin/isort if [ $? -ne 0 ]; then exit 1 diff --git a/pre-commit.d/prettier.sh b/pre-commit.d/prettier.sh index 86670c5..68f1bb2 100755 --- a/pre-commit.d/prettier.sh +++ b/pre-commit.d/prettier.sh @@ -3,7 +3,7 @@ FILES=$(git diff --cached --name-only --diff-filter=ACM "*.js" | sed 's| |\\ |g' if [ ! -z "$FILES" ]; then # Prettify all selected files - echo "$FILES" | xargs ./node_modules/.bin/prettier --write + echo "$FILES" | xargs prettier --write if [ $? -ne 0 ]; then exit 1 diff --git a/pre-commit.d/yapf.sh b/pre-commit.d/yapf.sh index df06a90..1d25d4d 100755 --- a/pre-commit.d/yapf.sh +++ b/pre-commit.d/yapf.sh @@ -3,7 +3,7 @@ FILES=$(git diff --cached --name-only --diff-filter=ACM "*.py" | sed 's| |\\ |g' if [ ! -z "$FILES" ]; then # Format all selected files - echo "$FILES" | xargs ./env/bin/yapf --in-place --verbose --style=./yapf.conf + echo "$FILES" | xargs $HOME/.local/bin/yapf --in-place --verbose --style=./yapf.conf if [ $? -ne 0 ]; then exit 1