From f09fdd3279da8103197fc4be455be86eea23e2df Mon Sep 17 00:00:00 2001 From: Hari Sekhon Date: Wed, 14 Aug 2024 23:17:32 +0200 Subject: [PATCH] updated .envrc --- .envrc | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/.envrc b/.envrc index 15bc469e..7555ecba 100644 --- a/.envrc +++ b/.envrc @@ -52,14 +52,20 @@ srcdir="$(cd "$(dirname "$src")" && pwd)" # Automatically install Pre-Commit Git hooks if not already present -if ! type -P pre-commit &>/dev/null && - uname -s | grep -q Darwin && - type -P brew &>/dev/null; then - echo - echo "Pre-commit is not installed - installing now..." - echo - brew install pre-commit - echo +if ! type -P pre-commit &>/dev/null; then + if uname -s | grep -q Darwin && + type -P brew &>/dev/null; then + echo + echo "Pre-commit is not installed - installing now using Homebrew..." + echo + brew install pre-commit + echo + elif type -P pip &>/dev/null; then + echo + echo "Pre-commit is not installed - installing now using Pip..." + echo + pip install pre-commit + fi fi if [ -f .pre-commit-config.yaml ] && @@ -188,6 +194,8 @@ if [ -f "$srcdir/.envrc-kubernetes" ]; then load_if_exists .envrc-kubernetes docker-desktop fi +# ============================================================================ # +# . E n v # ============================================================================ # echo