From 62f23123cb2a5ef594f405053d0b111c6e01de87 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 21 Aug 2023 19:41:49 +0100 Subject: general code cleanup on lbmk shell scripts in update/blobs/download, i saw instances where appdir was being deleted with rm -r, but the more appropriate command would rm -Rf. this is now fixed. other than that, i've mostly just simplified a bunch of if statements and consolidated some duplicated logic (e.g. if/else block for dependencies in build_dependencies() of update/blobs/download one or two functions and/or variables have been renamed, for greater clarity in the code, also removed a few messages that were redundant used printf instead of echo, in a few places, also fixed up the indentation in a few places Signed-off-by: Leah Rowe --- resources/scripts/misc/versioncheck | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'resources/scripts/misc') diff --git a/resources/scripts/misc/versioncheck b/resources/scripts/misc/versioncheck index 3118e297..01e69231 100755 --- a/resources/scripts/misc/versioncheck +++ b/resources/scripts/misc/versioncheck @@ -20,24 +20,20 @@ set -u -e version="version-unknown" -if [ -f version ]; then - version="$(cat version)" -fi +[ -f version ] && version="$(cat version)" version_="${version}" if [ -e ".git" ]; then - version="$(git describe --tags HEAD 2>&1)" \ - || version="git-$(git rev-parse HEAD 2>&1)" \ - || version="${version_}" + version="$(git describe --tags HEAD 2>&1)" || \ + version="git-$(git rev-parse HEAD 2>&1)" || \ + version="${version_}" printf "%s\n" "${version}" > version fi versiondate="version-date-unknown" -if [ -f versiondate ]; then - versiondate="$(cat versiondate)" -fi +[ -f versiondate ] && versiondate="$(cat versiondate)" versiondate_="${versiondate}" if [ -e ".git" ]; then - versiondate="$(git show --no-patch --no-notes --pretty='%ct' HEAD)" \ - || versiondate="${versiondate_}" + versiondate="$(git show --no-patch --no-notes --pretty='%ct' HEAD)" || \ + versiondate="${versiondate_}" printf "%s\n" "${versiondate}" > versiondate fi -- cgit v1.2.1