From b3fef083881be8dcd94cfa13002ac143a564b8a8 Mon Sep 17 00:00:00 2001 From: Tvrqvoise <5715027+Tvrqvoise@users.noreply.github.com> Date: Tue, 29 May 2018 12:01:06 -0500 Subject: [PATCH] Use universal she-bang for Debian-based systems On some versions of Debian (and thus, Ubuntu and friends), `node` is installed as `nodejs`. This means that the default node shebang does not work, since there is no `node` binary. This shebang runs as shell, and then invokes the remainder of the script as node or nodejs, depending on what's installed on the system. Because this happens in the shebang, it is outside of the `try / catch`, and therefore fails any git operations, regardless of if there are hooks installed or not. --- lib/hook-template.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/hook-template.js b/lib/hook-template.js index 6105f0f..cd92b33 100644 --- a/lib/hook-template.js +++ b/lib/hook-template.js @@ -1,4 +1,5 @@ -#!/usr/bin/env node +#!/bin/sh +':' //; exec "$(command -v nodejs || command -v node)" "$0" "$@" try { /**