From d4d468660dee8144e7cd12ab59ba169b10f0492e Mon Sep 17 00:00:00 2001 From: Daniel Hougaard Date: Wed, 20 Nov 2024 17:29:36 +0400 Subject: [PATCH] chore: check for CLI installation before pre-commit --- .husky/pre-commit | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.husky/pre-commit b/.husky/pre-commit index 4f18d25215..9a9f7b9e4c 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,6 +1,12 @@ #!/usr/bin/env sh . "$(dirname -- "$0")/_/husky.sh" +# Check if infisical is installed +if ! command -v infisical >/dev/null 2>&1; then + echo "\nError: Infisical CLI is not installed. Please install the Infisical CLI before comitting.\n You can refer to the documentation at https://infisical.com/docs/cli/overview\n\n" + exit 1 +fi + npx lint-staged infisical scan git-changes --staged -v