Files
pi-hosted/build/pre-commit
2021-12-29 20:19:59 -05:00

33 lines
904 B
Bash
Executable File

#!/bin/bash
# Check if script from build or script from hook and cd into build folder
scriptDir="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null || pwd )"
if [ "$( echo "$scriptDir" | rev | cut -d/ -f1 | rev )" == "build" ]; then
cd -- "$scriptDir" &> /dev/null || exit
else
cd -- "$(git rev-parse --show-toplevel)/build" &> /dev/null || exit
fi
# Get file location (Variables) from env file
homedir='../'
. env.sh
# Check if Template or appinfo has changed
if ! sha256sum -c --quiet "$verificationFile" &> /dev/null ; then
echo "Updating documentation..."
# Run all scripts
./generateList.sh
./generateREADME.sh
./generateToolsREADME.sh
echo "Update finished"
# Update lastrun.sha256
sha256sum "$appinfo" "$pt32" "$pt64" > "$verificationFile"
# Add files to stagging
git add -- "$verificationFile"
git add -- "$README"
git add -- "$TOOLSREADME"
git add -- "$AppList"
fi