:-'Generic Commit'
Some checks failed
dropshell-build / build (push) Failing after 2m41s

This commit is contained in:
Your Name 2025-05-31 11:13:22 +12:00
parent 50862165be
commit 422f62e5f9

View File

@ -4,8 +4,6 @@ set -euo pipefail
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
VERSIONDATE=$(date +%Y.%m%d.%H%M)
# If the user is not root, use sudo
SUDOCMD=""
[ "$EUID" -eq 0 ] || SUDOCMD="sudo"
@ -16,9 +14,6 @@ if [ -n "${SUDO_USER:-}" ] && [ "$SUDO_USER" != "root" ]; then
USER_HOME=$(eval echo "~${SUDO_USER}")
fi
VERSION_FILE="$USER_HOME/.config/dropshell-build/version"
mkdir -p "$(dirname "$VERSION_FILE")"
# test sudo is working or we're root (return non-zero if not root!)
if ! ${SUDOCMD:-} true; then
echo "Error: This script must be run as root or with sudo privileges." >&2
@ -329,7 +324,11 @@ function main() {
install_openssl_musl
echo "$VERSIONDATE" > "$VERSION_FILE" || echo "Error: Failed to write version file"
local VERSIONDATE
local CONFIG_DIR="$USER_HOME/.config/dropshell-build/"
mkdir -p "$CONFIG_DIR"
VERSIONDATE="$(date +%Y.%m%d.%H%M)"
echo "$VERSIONDATE" > "$CONFIG_DIR/version" || echo "Error: Failed to write version file to $CONFIG_DIR/version"
echo "Done"
}