diff --git a/files/home/.bash_profile b/files/home/.bash_profile index 0a45628..66f6c85 100644 --- a/files/home/.bash_profile +++ b/files/home/.bash_profile @@ -1,10 +1,2 @@ # Load .profile, containing login, non-bash related initializations. [ -f "$HOME/.profile" ] && source "$HOME/.profile" - -# Load .bashrc, containing non-login related bash initializations. -[ -f "$HOME/.bashrc" ] && 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/files/home/.bashrc b/files/home/.bashrc deleted file mode 100644 index b7119dc..0000000 --- a/files/home/.bashrc +++ /dev/null @@ -1,3 +0,0 @@ -# Load nvm bash dependency -[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm -[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion diff --git a/files/home/.profile b/files/home/.profile index 3679273..03da756 100644 --- a/files/home/.profile +++ b/files/home/.profile @@ -27,6 +27,7 @@ export DOTFILES=${DOTFILES:-"$HOME/.dotfiles"} # nvm export NVM_DIR=${NVM_DIR:-"$HOME/.nvm"} +mkdir -p "$NVM_DIR" [ -f "$NVM_DIR/nvm.sh" ] && source "$NVM_DIR/nvm.sh" # node (default v14) diff --git a/scripts/_utils.sh b/scripts/_utils.sh index 833eefa..ac68224 100755 --- a/scripts/_utils.sh +++ b/scripts/_utils.sh @@ -74,13 +74,13 @@ function stow_package { target=$(jq -r ".target" <<<"$1") case $target in - HOME) - rm -f $HOME/.bashrc - rm -f $HOME/.profile - target=$HOME - ;; - *) - ;; + HOME) + rm -f $HOME/.bashrc + rm -f $HOME/.profile + target=$HOME + ;; + *) ;; + esac echo "Stowing $ABS_DIR/files/$name to $target" diff --git a/scripts/install.d/02-fish.sh b/scripts/install.d/02-fish.sh index d8d9bf9..b6e8dca 100755 --- a/scripts/install.d/02-fish.sh +++ b/scripts/install.d/02-fish.sh @@ -1,9 +1,9 @@ #!/usr/bin/env bash fish --version -current_shell=`grep "^$USER" /etc/passwd` +current_shell=$(grep "^$USER" /etc/passwd) current_shell=${current_shell##*:} -fish_shell=`command -v fish` +fish_shell=$(command -v fish) if [[ "$current_shell" != "$fish_shell" ]]; then sudo usermod --shell "$fish_shell" "$USER" fi diff --git a/scripts/install.d/10-pyenv.sh b/scripts/install.d/10-pyenv.sh index 14d8d01..25de3be 100755 --- a/scripts/install.d/10-pyenv.sh +++ b/scripts/install.d/10-pyenv.sh @@ -9,8 +9,7 @@ if ! bin_in_path "pyenv"; then bash fi -eval "$(pyenv init -)" -eval "$(pyenv virtualenv-init -)" +eval "$(pyenv init --path)" pyenv update diff --git a/scripts/install.d/11-python.sh b/scripts/install.d/11-python.sh index 9999c6e..270c669 100755 --- a/scripts/install.d/11-python.sh +++ b/scripts/install.d/11-python.sh @@ -11,6 +11,6 @@ pip3 install --upgrade pip python3 --version pip3 --version -for dep in `jq -r ".pip_dependencies[]" $CONFIG`; do +for dep in $(jq -r ".pip_dependencies[]" $CONFIG); do pip3 install --upgrade $dep done diff --git a/scripts/install.d/13-nvm.sh b/scripts/install.d/13-nvm.sh index dd24ef5..edcca7c 100755 --- a/scripts/install.d/13-nvm.sh +++ b/scripts/install.d/13-nvm.sh @@ -5,7 +5,7 @@ if ! bin_in_path "nvm"; then "bash" fi -[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm +[ -s "$NVM_DIR/nvm.sh" ] && source "$NVM_DIR/nvm.sh" nvm --version nvm alias default lts/fermium diff --git a/scripts/install.d/14-yarn.sh b/scripts/install.d/14-yarn.sh index 81c5477..d12e319 100755 --- a/scripts/install.d/14-yarn.sh +++ b/scripts/install.d/14-yarn.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash yarn --version -for dep in `jq -r ".node_dependencies[]" $CONFIG`; do +for dep in $(jq -r ".node_dependencies[]" $CONFIG); do yarn global add $dep yarn global upgrade $dep done diff --git a/scripts/install.d/16-vim.sh b/scripts/install.d/16-vim.sh index 1d19578..24d84fe 100755 --- a/scripts/install.d/16-vim.sh +++ b/scripts/install.d/16-vim.sh @@ -3,12 +3,12 @@ # Install neovim from unstable debian repo if ! bin_in_path "nvim"; then curl -fsSL "https://ftp-master.debian.org/keys/archive-key-10.asc" | sudo apt-key add - - echo "deb http://deb.debian.org/debian unstable main" \ - | sudo tee /etc/apt/sources.list.d/unstable.list + echo "deb http://deb.debian.org/debian unstable main" | + sudo tee /etc/apt/sources.list.d/unstable.list echo "Package: neovim Pin: release a=unstable - Pin-Priority: 900" \ - | sudo tee /etc/apt/preferences.d/neovim + Pin-Priority: 900" | + sudo tee /etc/apt/preferences.d/neovim update install neovim fi diff --git a/scripts/run.sh b/scripts/run.sh index 259fcc0..edaefcc 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -9,5 +9,5 @@ docker build . \ docker run \ -v "$(pwd)"/logs:/home/test-user/.dotfiles/logs \ - dotfiles:$tag + dotfiles:$tag \ /bin/bash diff --git a/scripts/setup.sh b/scripts/setup.sh index dd0dfeb..2a8aeff 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -23,7 +23,7 @@ else fi # Download and untar repo -tmp_dir=`mktemp -d` +tmp_dir=$(mktemp -d) tmp_dest="$tmp_dir/dotfiles.tar.gz" wget "https://github.com/$author/$repository/archive/$branch.tar.gz" -qO $tmp_dest tar -C $tmp_dir -zxf $tmp_dest