Skip to content

Commit f4d879a

Browse files
committed
guix: more sanity checks for WORKSPACE_PATH
1 parent 07f056a commit f4d879a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

contrib/containers/guix/scripts/guix-check

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ set -eo pipefail
44

55
WORKSPACE_PATH="${1:-$(pwd)}"
66

7-
if [[ ! -d "$WORKSPACE_PATH" ]]; then
8-
echo "$0: $WORKSPACE_PATH is not a valid directory, exiting!"
7+
if [[ ! -d "${WORKSPACE_PATH}" || ! "${WORKSPACE_PATH}" = /* || ! -f "${WORKSPACE_PATH}/contrib/guix/libexec/prelude.bash" ]]; then
8+
echo "${0}: ${WORKSPACE_PATH} is not a valid directory, exiting!"
99
exit 1
1010
fi
1111

contrib/containers/guix/scripts/guix-start

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ set -eo pipefail
44

55
WORKSPACE_PATH="${1:-$(pwd)}"
66

7-
if [[ ! -d "$WORKSPACE_PATH" ]]; then
8-
echo "$0: $WORKSPACE_PATH is not a valid directory, exiting!"
7+
if [[ ! -d "${WORKSPACE_PATH}" || ! "${WORKSPACE_PATH}" = /* || ! -f "${WORKSPACE_PATH}/contrib/guix/guix-build" ]]; then
8+
echo "${0}: ${WORKSPACE_PATH} is not a valid directory, exiting!"
99
exit 1
1010
fi
1111

0 commit comments

Comments
 (0)