swh:1:snp:f521c49ab17ef7db6ec70b2430e1ed203f50383f
Raw File
Tip revision: bc8203fe68760fd81e7bf85b4163080ee2bebbcd authored by Wenqing Wang on 15 April 2020, 10:09:05 UTC
[Test] Added a test of RelPermNonWettingVanGenuchten
Tip revision: bc8203f
pre-commit-file-extensions.sh
#!/usr/bin/env bash

# set -e

# Check for uppercase letters in filename extensions
pattern=".*\.\w*([A-Z]+)\w*$"
files=$(echo $@ | grep -E "$pattern")

if [[ -n $files ]];
then
    echo "Attention!"
    echo "----------"
    echo "Found files that contain capital letters in the file extension."
    echo "Please rename the following files and commit again:"

    while read -r file; do
        echo -e '\E[0;32m'"$file"'\033[0m'
    done <<< "$files"
    # Abort commit
    exit 1
fi

exit 0
back to top