This commit is contained in:
parent
e0527e2a24
commit
b980de4347
@ -5,7 +5,6 @@ set -euo pipefail
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
||||
|
||||
VERSION=$(date +%Y.%m%d.%H%M)
|
||||
VERSION_FILE="$HOME/.config/dropshell-build/version"
|
||||
|
||||
# If the user is not root, use sudo
|
||||
SUDOCMD=""
|
||||
@ -17,6 +16,9 @@ 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
|
||||
|
Loading…
x
Reference in New Issue
Block a user