mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 07:26:13 -05:00
repl: Look for script files in (getcwd).
Fixes <https://bugs.gnu.org/43331>. * guix/scripts/repl.scm (guix-repl): Replace "." by (getcwd) * tests/guix-repl.sh: Add test. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
7194b63833
commit
d7f7ed39be
2 changed files with 8 additions and 1 deletions
|
@ -178,7 +178,10 @@ (define script
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(set-program-arguments script)
|
(set-program-arguments script)
|
||||||
(set-user-module)
|
(set-user-module)
|
||||||
(load-in-vicinity "." (car script)))))
|
|
||||||
|
;; When passed a relative file name, 'load-in-vicinity' searches the
|
||||||
|
;; file in %LOAD-PATH. Thus, pass (getcwd) instead of ".".
|
||||||
|
(load-in-vicinity (getcwd) (car script)))))
|
||||||
|
|
||||||
(when (null? script)
|
(when (null? script)
|
||||||
;; Start REPL
|
;; Start REPL
|
||||||
|
|
|
@ -45,6 +45,10 @@ EOF
|
||||||
|
|
||||||
test "`guix repl "$tmpfile"`" = "coreutils"
|
test "`guix repl "$tmpfile"`" = "coreutils"
|
||||||
|
|
||||||
|
# Make sure that the file can also be loaded when passed as a relative file
|
||||||
|
# name.
|
||||||
|
(cd "$(dirname "$tmpfile")"; test "$(guix repl "$(basename "$tmpfile")")" = "coreutils")
|
||||||
|
|
||||||
|
|
||||||
cat > "$module_dir/foo.scm"<<EOF
|
cat > "$module_dir/foo.scm"<<EOF
|
||||||
(define-module (foo)
|
(define-module (foo)
|
||||||
|
|
Loading…
Reference in a new issue