From 3cec824246e335aee24bcc50acd623d0c2341eb4 Mon Sep 17 00:00:00 2001 From: David Guillen Fandos Date: Sun, 6 Jul 2025 10:28:22 +0200 Subject: [PATCH] Check if we are in the git repo (or perhaps in a tarball) --- build-and-install.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/build-and-install.sh b/build-and-install.sh index 1470f2de..4011fffc 100755 --- a/build-and-install.sh +++ b/build-and-install.sh @@ -45,8 +45,11 @@ mkdir -p $PSPDEV/share/licenses/PrxEncrypter cp tools/PrxEncrypter/LICENSE $PSPDEV/share/licenses/PrxEncrypter ## Store build information -BUILD_FILE="${PSPDEV}/build.txt" -if [[ -f "${BUILD_FILE}" ]]; then - sed -i'' '/^pspsdk /d' "${BUILD_FILE}" +if [ -d .git ]; then + BUILD_FILE="${PSPDEV}/build.txt" + if [[ -f "${BUILD_FILE}" ]]; then + sed -i'' '/^pspsdk /d' "${BUILD_FILE}" + fi + git log -1 --format="pspsdk %H %cs %s" >> "${BUILD_FILE}" fi -git log -1 --format="pspsdk %H %cs %s" >> "${BUILD_FILE}" +