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
|
# auto-detect which ssh-agent to use
|
||||||
|
if ("XDG_RUNTIME_DIR" in $env) {
|
||||||
if (which tkey-ssh-agent | is-empty) {
|
if (which tkey-ssh-agent | is-empty) {
|
||||||
$env.SSH_AUTH_SOCK = $"($env.XDG_RUNTIME_DIR)/ssh-agent.socket"
|
$env.SSH_AUTH_SOCK = $"($env.XDG_RUNTIME_DIR)/ssh-agent.socket"
|
||||||
} else {
|
} else {
|
||||||
$env.SSH_AUTH_SOCK = $"($env.XDG_RUNTIME_DIR)/tkey-ssh-agent/sock"
|
$env.SSH_AUTH_SOCK = $"($env.XDG_RUNTIME_DIR)/tkey-ssh-agent/sock"
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$env.GPG_TTY = (tty)
|
$env.GPG_TTY = (tty)
|
||||||
$env.BROWSER = "firefox"
|
$env.BROWSER = "firefox"
|
||||||
|
|||||||
Reference in New Issue
Block a user