From fe9b4953b3919439e8d261e76eae14349154c055 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Sat, 16 Mar 2024 22:36:34 +0100 Subject: [PATCH] Add small script for setting up a proper development environment. --- {git_hooks => scripts}/pre-commit | 0 scripts/setup_dev_environment.sh | 10 ++++++++++ 2 files changed, 10 insertions(+) rename {git_hooks => scripts}/pre-commit (100%) create mode 100755 scripts/setup_dev_environment.sh diff --git a/git_hooks/pre-commit b/scripts/pre-commit similarity index 100% rename from git_hooks/pre-commit rename to scripts/pre-commit diff --git a/scripts/setup_dev_environment.sh b/scripts/setup_dev_environment.sh new file mode 100755 index 0000000..8ea3a44 --- /dev/null +++ b/scripts/setup_dev_environment.sh @@ -0,0 +1,10 @@ +#!/bin/sh +set -e + +if [ ! -d '.git' ]; then + echo "Cannot find .git/, please run me from your cloned repo's top directory!" +elif [ ! -f '.git/hooks/pre-commit' ]; then + echo 'Linking pre-commit hook.' + cd .git/hooks/ + ln -s ../../scripts/pre-commit +fi -- 2.30.2