From 4802eec0d3cb87eabe94f833b0f62feba5e08f8f Mon Sep 17 00:00:00 2001 From: 3y3 <3y3@ya.ru> Date: Sun, 11 Aug 2024 02:20:57 +0300 Subject: [PATCH] fix: Proxy husky bin --- bin/husky | 11 +++++++++++ package.json | 5 +++-- 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100755 bin/husky diff --git a/bin/husky b/bin/husky new file mode 100755 index 0000000..99cc16b --- /dev/null +++ b/bin/husky @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +BINDIR=$(dirname $(node -pe "require.resolve('husky')")) + +if [[ -z "$BINDIR" ]]; then + echo "Required package 'husky' not found" + exit 1 +fi + +# Redirect to original husky bin +$BINDIR/bin.js $@ \ No newline at end of file diff --git a/package.json b/package.json index 99c6580..df6b9df 100644 --- a/package.json +++ b/package.json @@ -3,10 +3,11 @@ "version": "1.0.0", "description": "Diplodoc platform internal utility set for linting", "bin": { - "lint": "./bin/lint" + "lint": "./bin/lint", + "husky": "./bin/husky" }, "scripts": { - "test": "exit 0" + "test": "cd test && npm start" }, "exports": { "./eslint-config": "./eslint-common-config.js",