lade 0.17.2

Automatically load secrets from your preferred vault as environment variables, and clear them once your shell command is over.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
function preexec_lade --on-event fish_preexec
    if test (string sub -l 5 -- "$argv") = "lade "; or test "$argv" = "lade"; or test "$argv" = "source off.fish"
        return
    end
    set --global LADE "$argv[1]"
    source (lade set -- "$LADE" | psub)
end

function precmd_lade --on-event fish_postexec
    if set -q LADE
        if test "$LADE" != "source on.fish"
            source (lade unset -- "$LADE" | psub)
        end
        set --global --erase LADE
    end
end