diff --git a/metadata.json b/metadata.json index 71ea53c..7673722 100644 --- a/metadata.json +++ b/metadata.json @@ -1,5 +1,6 @@ { "dependencies": [ - "github.com/chlorm/elvish-stl" + "github.com/chlorm/elvish-stl", + "github.com/chlorm/elvish-xdg" ] } diff --git a/tmpfs-automount.elv b/tmpfs-automount.elv index 4195b04..137f496 100644 --- a/tmpfs-automount.elv +++ b/tmpfs-automount.elv @@ -20,7 +20,10 @@ use github.com/chlorm/elvish-xdg/xdg fn main { # Make sure XDG_RUNTIME_DIR is configured. - local:capture = (xdg:get-dir XDG_RUNTIME_DIR) + local:run = (xdg:get-dir XDG_RUNTIME_DIR) + if (not (==s (get-env XDG_RUNTIME_DIR) $run)) { + set-env XDG_RUNTIME_DIR $run + } local:mount-cache = $false try {