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)
|
(let* ((target (string-append (@@ (env) %env-directory)
|
||||||
"/" (symbol->string target-sym)))
|
"/" (symbol->string target-sym)))
|
||||||
;; TODO should actually detect if overlay is mounted not that the
|
(mnt (if (environment-mounted? env)
|
||||||
;; directory exists.
|
(or (environment->overlay-mount-maybe env)
|
||||||
(mnt (mount-environment env #:tag onto #:target target))
|
(throw 'wrong-mount?))
|
||||||
|
(mount-environment env #:tag onto #:target target)))
|
||||||
(mappings (append (map (remap #f) expose)
|
(mappings (append (map (remap #f) expose)
|
||||||
(map (remap #t) share))))
|
(map (remap #t) share))))
|
||||||
(exec-in-rustup-environment '("./.cargo/bin/rust-analyzer")
|
(exec-in-rustup-environment '("./.cargo/bin/rust-analyzer")
|
||||||
#:home mnt
|
#:home (overlay-mount-merged mnt)
|
||||||
#:mappings mappings)
|
#:mappings mappings)
|
||||||
(sync)
|
(sync)
|
||||||
(system* "umount" target)
|
(system* "umount" target)
|
||||||
|
|
Loading…
Reference in a new issue