diff --git a/package.json b/package.json index e8b6794..eec14c1 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "test:dev": "bun test --watch", "test": "bun test", "test:ci": "bun test --coverage", - "postinstall": "husky install" + "postinstall": "scripts/install-git-hooks.sh" }, "trustedDependencies": ["."], "type": "module", diff --git a/scripts/install-git-hooks.sh b/scripts/install-git-hooks.sh new file mode 100755 index 0000000..ac1dec5 --- /dev/null +++ b/scripts/install-git-hooks.sh @@ -0,0 +1,10 @@ +#!/bin/env sh + +if sh -c ": >/dev/tty" >/dev/null 2>/dev/null; then + # /dev/tty is available and usable + echo "Installing Husky hooks" + bun husky install +else + # /dev/tty is not available + echo "Ignoring Husky hook install" +fi \ No newline at end of file