1
0
Fork 0
mirror of https://github.com/kastdeur/dotfiles.git synced 2024-12-22 09:13:33 +01:00

Made separate bashrc and profile which parse eachother.

So everythin is always defined in a bash shell
This commit is contained in:
Eric Teunis de Boone 2016-09-26 18:11:51 +02:00
parent 37123ca4cd
commit d47333930f
6 changed files with 22 additions and 32 deletions

View file

@ -5,7 +5,12 @@
# If not running interactively, don't do anything # If not running interactively, don't do anything
[ -z "$PS1" ] && return [ -z "$PS1" ] && return
[ ! -z "$DOTFILES" ] && DOTBASH="$DOTFILES/bash" [ -z "$DOTFILES" ] && source ~/.profile
##
[ -z "$DOTFILES" ] && echo ".profile missing" && exit 1
DOTBASH="$DOTFILES/bash"
# make less more friendly for non-text input files, see lesspipe(1) # make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

1
bash/profile Normal file
View file

@ -0,0 +1 @@
[ -z "$DOTFILES" ] && source "$HOME/.profile"

View file

@ -7,10 +7,10 @@
- link: - link:
~/.bashrc: bash/bashrc ~/.bashrc: bash/bashrc
~/.profile: profiles/main ~/.profile: profile.sh
~/.gitconfig: git/gitconfig ~/.gitconfig: git/gitconfig
~/.tmux.conf: tmux/tmux.conf ~/.tmux.conf: tmux/tmux.conf
~/.vimrc: vim/vimrc ~/.vimrc: vim/vimrc
- shell: #- shell:
- git submodules update # after linking ~/.gitconfig # - git submodules update # after linking ~/.gitconfig

25
profile
View file

@ -1,25 +0,0 @@
# Define DOTFILES for easy access
DOTFILES="$HOME/.dotfiles"
# Add DOTFILES/bin/ to PATH
DOTBIN="$HOME/.bin"
if [ -d "$DOTBIN" ]; then
export PATH="$PATH:$DOTBIN"
fi
# Always try to use vi(m) if possible
export EDITOR="vi"
# Source Envs
DOTENVS="$HOME/.envs"
if [ -d "DOTENVS" ]; then
source "$DOTENVS/*.active"
fi
# Source Bashrc if BASH
if [ "$BASH" ] && [ -f ~/.bashrc ]; then
source ~/.bashrc
fi

9
profile.sh Normal file
View file

@ -0,0 +1,9 @@
# Define DOTFILES for easy access
DOTFILES="$HOME/.dotfiles"
# Source main profile
[ -r "$DOTFILES/profiles/main.sh" ] && source "$DOTFILES/profiles/main.sh"
# Source machine specific profile
[ -r "$DOTFILES/profiles/$HOSTNAME.profile"] && source "$DOTFILES/profiles/$HOSTNAME.profile"

View file

@ -1,6 +1,6 @@
DOTFILES="$HOME/.dotfiles" DOTFILES="$HOME/.dotfiles"
#Add DOTFILES/bin/ to PATH #Add DOTFILES/bin/ to PATH
DOTBIN="$HOME/.bin" DOTBIN="$DOTFILES/bin"
if [ -d "$DOTBIN" ]; then if [ -d "$DOTBIN" ]; then
export PATH="$PATH:$DOTBIN" export PATH="$PATH:$DOTBIN"
fi fi
@ -19,6 +19,6 @@ fi
# Source Bashrc if BASH # Source Bashrc if BASH
if [ "$BASH" ] && [ -f ~/.bashrc ]; then if [ "$BASH" ] && [ -f $DOTFILES/bash/bashrc ]; then
source ~/.bashrc source $DOTFILES/bash/bashrc
fi fi