rust: Check if environment already mounted
This commit is contained in:
parent
a2ea1192f3
commit
9d574fcdd1
1 changed files with 5 additions and 4 deletions
9
env/rust.scm
vendored
9
env/rust.scm
vendored
|
@ -180,13 +180,14 @@ function."
|
|||
|
||||
(let* ((target (string-append (@@ (env) %env-directory)
|
||||
"/" (symbol->string target-sym)))
|
||||
;; TODO should actually detect if overlay is mounted not that the
|
||||
;; directory exists.
|
||||
(mnt (mount-environment env #:tag onto #:target target))
|
||||
(mnt (if (environment-mounted? env)
|
||||
(or (environment->overlay-mount-maybe env)
|
||||
(throw 'wrong-mount?))
|
||||
(mount-environment env #:tag onto #:target target)))
|
||||
(mappings (append (map (remap #f) expose)
|
||||
(map (remap #t) share))))
|
||||
(exec-in-rustup-environment '("./.cargo/bin/rust-analyzer")
|
||||
#:home mnt
|
||||
#:home (overlay-mount-merged mnt)
|
||||
#:mappings mappings)
|
||||
(sync)
|
||||
(system* "umount" target)
|
||||
|
|
Loading…
Reference in a new issue