feat: enable pre-commit checks

This commit is contained in:
Michael Mandl 2024-07-10 13:40:41 +02:00
parent c2afb2c5d1
commit a13a15cbd9
Signed by: mandlm
GPG key ID: 088ED38F036C7AF2
12 changed files with 110 additions and 26 deletions

View file

@ -82,7 +82,7 @@
uri=''${1}
dir=''${2}
if [[ -z ''${dir} ]]; then
if [[ -z ''${dir} ]]; then
dir=''$(basename ''${1} .git)
fi
@ -102,17 +102,17 @@
'')
(writeShellScriptBin "git-make-relative" ''
gitfile=''${1}
if [[ -z ''${gitfile} ]]; then
if [[ -z ''${gitfile} ]]; then
gitfile=".git"
fi
fi
if [[ ! -f ''${gitfile} ]]; then
if [[ ! -f ''${gitfile} ]]; then
echo "file ''${gitfile} does not exist"
exit 1
fi
exit 1
fi
gitdir=$(grep "gitdir:" ''${gitfile} | cut -d: -f2 | xargs)
rel_gitdir=$(realpath -s --relative-to=. ''${gitdir})
@ -123,4 +123,3 @@
'')
];
}