From 826cc598b9908f45382e2200c77d21a134b88688 Mon Sep 17 00:00:00 2001 From: Andrejus Date: Fri, 20 Mar 2020 19:04:51 +0000 Subject: [PATCH] split out .profile --- Makefile | 6 +++--- bash/.bash_profile | 10 ++++++++++ bash/.bashrc | 34 ---------------------------------- bash/.profile | 29 +++++++++++++++++++++++++++++ fish/config.fish | 3 --- 5 files changed, 42 insertions(+), 40 deletions(-) create mode 100644 bash/.bash_profile create mode 100644 bash/.profile diff --git a/Makefile b/Makefile index 71f09e1..2123784 100644 --- a/Makefile +++ b/Makefile @@ -19,12 +19,12 @@ clean: # Build and tag docker image build: - docker build . -t dotfiles + docker build . -t dotfiles:latest # Run tests in docker container (args to specify test) test: - docker run dotfiles + docker run dotfiles:latest # Launch bash in docker container start: - docker run -it dotfiles /bin/bash + docker run -it dotfiles:latest /bin/bash diff --git a/bash/.bash_profile b/bash/.bash_profile new file mode 100644 index 0000000..afc8566 --- /dev/null +++ b/bash/.bash_profile @@ -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/ diff --git a/bash/.bashrc b/bash/.bashrc index 2d8ab8e..ebc3ff2 100644 --- a/bash/.bashrc +++ b/bash/.bashrc @@ -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) case "$TERM" in xterm-color|*-256color) color_prompt=yes;; diff --git a/bash/.profile b/bash/.profile new file mode 100644 index 0000000..b2bfe50 --- /dev/null +++ b/bash/.profile @@ -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" diff --git a/fish/config.fish b/fish/config.fish index 97193fd..85f4204 100644 --- a/fish/config.fish +++ b/fish/config.fish @@ -24,9 +24,6 @@ set -x PATH $POETRY_ROOT/bin $PATH # nvm # set NVM_ROOT $HOME/.nvm # set -x PATH $NVM_ROOT/bin $PATH -# -# - # ---------------------------------------------------------------------------- # # Fish specific