-
Notifications
You must be signed in to change notification settings - Fork 2
/
.startup.sh
48 lines (41 loc) · 1.22 KB
/
.startup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env sh
# This script should be run at start up by sh-like shells
# This of course does not include fish.
# For fish see ~/dotscripts/setup/fish and ~/.config/fish/config.fish
# Determine current running shell.
# https://unix.stackexchange.com/a/72475
if test -n "$ZSH_VERSION"; then
CURSHELL=zsh
elif test -n "$FISH_VERSION"; then
CURSHELL=fish
elif test -n "$BASH_VERSION"; then
CURSHELL=bash
elif test -n "$KSH_VERSION"; then
CURSHELL=ksh
elif test -n "$FCEDIT"; then
CURSHELL=ksh
elif test -n "$NU_VERISON"; then
CURSHELL=nu
elif test -n "$PS3"; then
CURSHELL=unknown
else
CURSHELL=sh
fi
# Aliases
source ~/.aliases
# Add the paths
export PATH="$(~/dotscripts/convert/addpath):$PATH"
# Hook (the) direnv
if ! command -v direnv &> /dev/null; then
# TODO: Ignore if direnv hook retured status 1
eval "$(direnv hook $CURSHELL)"
fi
# export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
# ^ Above is commented because it's already in ~/.exportenvs
# Load (the) nvm
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$HOME/.exportenvs" ] && \. "$HOME/.exportenvs"
# Pyenv
if ! command -v pyenv &> /dev/null; then
eval "$(pyenv init -)"
fi