summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--guix/scripts/shell.scm7
-rw-r--r--tests/guix-shell.sh4
2 files changed, 7 insertions, 4 deletions
diff --git a/guix/scripts/shell.scm b/guix/scripts/shell.scm
index c7eba429d5..5749485a44 100644
--- a/guix/scripts/shell.scm
+++ b/guix/scripts/shell.scm
@@ -283,8 +283,9 @@ Return the modified OPTS."
("guix.scm" (alist-cons 'load `(package ,file) opts))
("manifest.scm" (alist-cons 'manifest file opts))))
(begin
- (warning (G_ "not loading '~a' because not authorized to do so~%")
- file)
+ (report-error
+ (G_ "not loading '~a' because not authorized to do so~%")
+ file)
(display-hint (format #f (G_ "To allow automatic loading of
@file{~a} when running @command{guix shell}, you must explicitly authorize its
directory, like so:
@@ -295,7 +296,7 @@ echo ~a >> ~a
file
(dirname file)
(authorized-directory-file)))
- opts))))))
+ (exit 1)))))))
;;;
diff --git a/tests/guix-shell.sh b/tests/guix-shell.sh
index 95725cba2d..3bdf625189 100644
--- a/tests/guix-shell.sh
+++ b/tests/guix-shell.sh
@@ -39,7 +39,9 @@ guix shell --bootstrap --pure guile-bootstrap -- guile --version
cat > "$tmpdir/guix.scm" <<EOF
This is a broken guix.scm file.
EOF
-(cd "$tmpdir"; SHELL="$(type -P true)" guix shell --bootstrap)
+! (cd "$tmpdir"; SHELL="$(type -P true)" guix shell --bootstrap 2> "stderr")
+grep "not authorized" "$tmpdir/stderr"
+rm "$tmpdir/stderr"
# Authorize the directory.
echo "$(realpath "$tmpdir")" > "$configdir/guix/shell-authorized-directories"