nushell: Don't assume that XDG_RUNTIME_DIR is set
This commit is contained in:
@ -86,11 +86,13 @@ $env.PATH = ($env.PATH | split row (char esep) | prepend [
|
||||
])
|
||||
|
||||
# auto-detect which ssh-agent to use
|
||||
if ("XDG_RUNTIME_DIR" in $env) {
|
||||
if (which tkey-ssh-agent | is-empty) {
|
||||
$env.SSH_AUTH_SOCK = $"($env.XDG_RUNTIME_DIR)/ssh-agent.socket"
|
||||
} else {
|
||||
$env.SSH_AUTH_SOCK = $"($env.XDG_RUNTIME_DIR)/tkey-ssh-agent/sock"
|
||||
}
|
||||
}
|
||||
|
||||
$env.GPG_TTY = (tty)
|
||||
$env.BROWSER = "firefox"
|
||||
|
||||
Reference in New Issue
Block a user