split out .profile

This commit is contained in:
Andrejus
2020-03-20 19:04:51 +00:00
parent 9fa663b41f
commit 826cc598b9
5 changed files with 42 additions and 40 deletions

View File

@@ -19,12 +19,12 @@ clean:
# Build and tag docker image # Build and tag docker image
build: build:
docker build . -t dotfiles docker build . -t dotfiles:latest
# Run tests in docker container (args to specify test) # Run tests in docker container (args to specify test)
test: test:
docker run dotfiles docker run dotfiles:latest
# Launch bash in docker container # Launch bash in docker container
start: start:
docker run -it dotfiles /bin/bash docker run -it dotfiles:latest /bin/bash

10
bash/.bash_profile Normal file
View File

@@ -0,0 +1,10 @@
# Load .profile, containing login, non-bash related initializations.
source "$HOME/.profile"
# Load .bashrc, containing non-login related bash initializations.
source "$HOME/.bashrc"
# References:
# https://unix.stackexchange.com/questions/192521/loading-profile-from-bash-profile-or-not-using-bash-profile-at-all
# https://www.stefaanlippens.net/my_bashrc_aliases_profile_and_other_stuff/

View File

@@ -1,37 +1,3 @@
# ---------------------------------------------------------------------------- #
# Cross-shell
# ---------------------------------------------------------------------------- #
# config
XDG_CONFIG_HOME="$HOME/.config"
# workspace
WORKSPACE="$HOME/workspace"
# .local
export PATH="$HOME/.local/bin:$PATH"
# pyenv
PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
export PATH="$PYENV_ROOT/shims:$PATH"
[ -x "$(command -v pyenv)" ] && eval "$(pyenv init -)"
# poetry
POETRY_ROOT="$HOME/.poetry"
export PATH="$POETRY_ROOT/bin:$PATH"
# nvm
NVM_DIR="$HOME/.nvm"
export PATH="$NVM_DIR/bin:$PATH"
[ -s "$NVM_DIR/nvm.sh" ] && source "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && source "$NVM_DIR/bash_completion"
# ---------------------------------------------------------------------------- #
# Bash specific
# ---------------------------------------------------------------------------- #
# set a fancy prompt (non-color, unless we know we "want" color) # set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in case "$TERM" in
xterm-color|*-256color) color_prompt=yes;; xterm-color|*-256color) color_prompt=yes;;

29
bash/.profile Normal file
View File

@@ -0,0 +1,29 @@
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
# config
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_CONFIG_HOME="$HOME/.config"
# workspace
export WORKSPACE="$HOME/workspace"
# .local
export PATH="$HOME/.local/bin:$PATH"
# pyenv
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
export PATH="$PYENV_ROOT/shims:$PATH"
[ -x "$(command -v pyenv)" ] && eval "$(pyenv init -)"
# poetry
export POETRY_ROOT="$HOME/.poetry"
export PATH="$POETRY_ROOT/bin:$PATH"
# nvm
export NVM_DIR="$HOME/.nvm"
export PATH="$NVM_DIR/bin:$PATH"
[ -s "$NVM_DIR/nvm.sh" ] && source "$NVM_DIR/nvm.sh"

View File

@@ -24,9 +24,6 @@ set -x PATH $POETRY_ROOT/bin $PATH
# nvm # nvm
# set NVM_ROOT $HOME/.nvm # set NVM_ROOT $HOME/.nvm
# set -x PATH $NVM_ROOT/bin $PATH # set -x PATH $NVM_ROOT/bin $PATH
#
#
# ---------------------------------------------------------------------------- # # ---------------------------------------------------------------------------- #
# Fish specific # Fish specific