From fd2ac7975aad5e184927f2e11ec20b9602f5fd25 Mon Sep 17 00:00:00 2001 From: Alem Tuzlak Date: Wed, 17 Jul 2024 14:10:06 +0200 Subject: [PATCH] Switched to modern tools --- .husky/_/pre-commit | 63 ------------------------------------- .husky/_/prepare-commit-msg | 63 ------------------------------------- 2 files changed, 126 deletions(-) delete mode 100644 .husky/_/pre-commit delete mode 100644 .husky/_/prepare-commit-msg diff --git a/.husky/_/pre-commit b/.husky/_/pre-commit deleted file mode 100644 index a1fe9b4..0000000 --- a/.husky/_/pre-commit +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/sh - -if [ "$LEFTHOOK_VERBOSE" = "1" -o "$LEFTHOOK_VERBOSE" = "true" ]; then - set -x -fi - -if [ "$LEFTHOOK" = "0" ]; then - exit 0 -fi - -call_lefthook() -{ - if test -n "$LEFTHOOK_BIN" - then - "$LEFTHOOK_BIN" "$@" - elif lefthook.exe -h >/dev/null 2>&1 - then - lefthook.exe "$@" - elif lefthook.bat -h >/dev/null 2>&1 - then - lefthook.bat "$@" - else - dir="$(git rev-parse --show-toplevel)" - osArch=$(uname | tr '[:upper:]' '[:lower:]') - cpuArch=$(uname -m | sed 's/aarch64/arm64/;s/x86_64/x64/') - if test -f "$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook.exe" - then - "$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook.exe" "$@" - elif test -f "$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook.exe" - then - "$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook.exe" "$@" - elif test -f "$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook.exe" - then - "$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook.exe" "$@" - elif test -f "$dir/node_modules/lefthook/bin/index.js" - then - "$dir/node_modules/lefthook/bin/index.js" "$@" - - elif bundle exec lefthook -h >/dev/null 2>&1 - then - bundle exec lefthook "$@" - elif yarn lefthook -h >/dev/null 2>&1 - then - yarn lefthook "$@" - elif pnpm lefthook -h >/dev/null 2>&1 - then - pnpm lefthook "$@" - elif swift package plugin lefthook >/dev/null 2>&1 - then - swift package --disable-sandbox plugin lefthook "$@" - elif command -v mint >/dev/null 2>&1 - then - mint run csjones/lefthook-plugin "$@" - elif command -v npx >/dev/null 2>&1 - then - npx lefthook "$@" - else - echo "Can't find lefthook in PATH" - fi - fi -} - -call_lefthook run "pre-commit" "$@" diff --git a/.husky/_/prepare-commit-msg b/.husky/_/prepare-commit-msg deleted file mode 100644 index f182dfd..0000000 --- a/.husky/_/prepare-commit-msg +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/sh - -if [ "$LEFTHOOK_VERBOSE" = "1" -o "$LEFTHOOK_VERBOSE" = "true" ]; then - set -x -fi - -if [ "$LEFTHOOK" = "0" ]; then - exit 0 -fi - -call_lefthook() -{ - if test -n "$LEFTHOOK_BIN" - then - "$LEFTHOOK_BIN" "$@" - elif lefthook.exe -h >/dev/null 2>&1 - then - lefthook.exe "$@" - elif lefthook.bat -h >/dev/null 2>&1 - then - lefthook.bat "$@" - else - dir="$(git rev-parse --show-toplevel)" - osArch=$(uname | tr '[:upper:]' '[:lower:]') - cpuArch=$(uname -m | sed 's/aarch64/arm64/;s/x86_64/x64/') - if test -f "$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook.exe" - then - "$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook.exe" "$@" - elif test -f "$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook.exe" - then - "$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook.exe" "$@" - elif test -f "$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook.exe" - then - "$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook.exe" "$@" - elif test -f "$dir/node_modules/lefthook/bin/index.js" - then - "$dir/node_modules/lefthook/bin/index.js" "$@" - - elif bundle exec lefthook -h >/dev/null 2>&1 - then - bundle exec lefthook "$@" - elif yarn lefthook -h >/dev/null 2>&1 - then - yarn lefthook "$@" - elif pnpm lefthook -h >/dev/null 2>&1 - then - pnpm lefthook "$@" - elif swift package plugin lefthook >/dev/null 2>&1 - then - swift package --disable-sandbox plugin lefthook "$@" - elif command -v mint >/dev/null 2>&1 - then - mint run csjones/lefthook-plugin "$@" - elif command -v npx >/dev/null 2>&1 - then - npx lefthook "$@" - else - echo "Can't find lefthook in PATH" - fi - fi -} - -call_lefthook run "prepare-commit-msg" "$@"