I am trying to run a script with pre-commit hook. Here is my script:
build_script.sh
#! /bin/bash
echo "Stage 1: Preparing CMake configuration"
.pre-commit-config.yaml
fail_fast: false
- repo: local
hooks:
- id: Generate build
name: Generate build
entry: sh build_script.sh
language: system
always_run: true
pass_filenames: false
I can see when I run command git commit -m "message"
, the hook calls the script and Generate build
will Pass. However, I do not see the echo on the terminal. I would like to see the message, "Stage 1: Preparing CMake configuration"
. What is wrong with this setup?
sh -x build_script.sh
? – Seddonsh -x build_script.sh
as entry point – Damson-x
also does not show up? This is IMO strange design of pre-commit, because stderr is usually used to signal an error, and I find it odd that pre-commit hides stderr as well.... – Seddon