Skip to content

Commit

Permalink
update bash only
Browse files Browse the repository at this point in the history
  • Loading branch information
Ant0wan committed Mar 11, 2024
1 parent f0d2ded commit 4746ad4
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tools/bash.install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
set -o errexit
set -o nounset
githubsource="https://raw.githubusercontent.com/Ant0wan/config-and-tools/main/config/"
if test -e ~/.bashrc; then
if ! grep -Fxq ' for rc in ~/.bashrc.d/*; do' ~/.bashrc; then

append_rc() {
printf '
# User specific aliases and functions
if [ -d ~/.bashrc.d ]; then
Expand All @@ -17,11 +17,16 @@ fi
unset rc
' >> ~/.bashrc
fi
}

if test -e ~/.bashrc; then
if ! grep -Fxq ' for rc in ~/.bashrc.d/*; do' ~/.bashrc; then
append_rc
fi
else
if test -e /etc/skel/.bashrc; then
cp /etc/skel/.bashrc ~
append_rc
else
wget "${githubsource}bashrc" -O "$HOME"/.bashrc
fi
Expand Down

0 comments on commit 4746ad4

Please sign in to comment.