guix: more sanity checks for WORKSPACE_PATH

This commit is contained in:
UdjinM6 2024-11-12 16:33:04 +03:00
parent 07f056a377
commit f4d879a0b3
No known key found for this signature in database
GPG Key ID: 83592BD1400D58D9
2 changed files with 4 additions and 4 deletions

View File

@ -4,8 +4,8 @@ set -eo pipefail
WORKSPACE_PATH="${1:-$(pwd)}"
if [[ ! -d "$WORKSPACE_PATH" ]]; then
echo "$0: $WORKSPACE_PATH is not a valid directory, exiting!"
if [[ ! -d "${WORKSPACE_PATH}" || ! "${WORKSPACE_PATH}" = /* || ! -f "${WORKSPACE_PATH}/contrib/guix/libexec/prelude.bash" ]]; then
echo "${0}: ${WORKSPACE_PATH} is not a valid directory, exiting!"
exit 1
fi

View File

@ -4,8 +4,8 @@ set -eo pipefail
WORKSPACE_PATH="${1:-$(pwd)}"
if [[ ! -d "$WORKSPACE_PATH" ]]; then
echo "$0: $WORKSPACE_PATH is not a valid directory, exiting!"
if [[ ! -d "${WORKSPACE_PATH}" || ! "${WORKSPACE_PATH}" = /* || ! -f "${WORKSPACE_PATH}/contrib/guix/guix-build" ]]; then
echo "${0}: ${WORKSPACE_PATH} is not a valid directory, exiting!"
exit 1
fi