1#!/bin/sh
2# SPDX-License-Identifier: LGPL-2.1-or-later
3set -eu
4
5cd "${MESON_SOURCE_ROOT:?}"
6
7if [ ! -f .git/hooks/pre-commit.sample ] || [ -f .git/hooks/pre-commit ]; then
8    exit 2 # not needed
9fi
10
11cp -p .git/hooks/pre-commit.sample .git/hooks/pre-commit
12chmod +x .git/hooks/pre-commit
13echo 'Activated pre-commit hook'
14