31 lines
577 B
Bash
Executable file
31 lines
577 B
Bash
Executable file
#!/usr/bin/env sh
|
|
|
|
# Set up logging.
|
|
log() { echo "📦️ $(basename $0): $@"; }
|
|
|
|
# Normalize our environment.
|
|
cd $(dirname $0)/..
|
|
|
|
# Make sure we have the needed executables installed.
|
|
for e in dotnet lefthook prettier nixfmt
|
|
do
|
|
if ! which $e >& /dev/null
|
|
then
|
|
log "Cannot find '$e' in the path"
|
|
exit 1
|
|
fi
|
|
done
|
|
|
|
# Make sure we have lefthook is installed.
|
|
if [ ! -f .git/hooks/pre-commit ]
|
|
then
|
|
log "installing lefthook"
|
|
lefthook install
|
|
fi
|
|
|
|
# Make sure our tools are installed.
|
|
log "install .NET tools"
|
|
dotnet tool restore
|
|
|
|
# Everything is good.
|
|
exit 0
|