summaryrefslogtreecommitdiff
path: root/public/zsh/.zprofile
blob: 2882524c7b4884602187d68fbdc0430ff6fdf52a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Mac specific hack to prepend to $PATH
# This is shit because it runs zshenv twice :/
# https://stackoverflow.com/questions/59131915/zsh-path-variable-entries-are-backwards-on-os-x-catalina
if [ "$(uname -s)" = "Darwin" ]; then
        [[ -f $HOME/.zshenv ]] && source $HOME/.zshenv
        typeset -U PATH
fi

function vim_wrap() {
        [ -z "$VIMRUNTIME" ] && nvim "$@" || echo "no inception shit"
}

function awsume() {
        unset AWS_PROFILE
        unset AWS_ACCESS_KEY_ID
        unset AWS_SECRET_ACCESS_KEY
        unset AWS_SESSION_TOKEN
        source <(aws session-env --profile "$@")
        export AWS_PROFILE=$1
}