📝 docs: add inline comments

This commit is contained in:
eshanized
2025-01-02 11:14:09 +05:30
parent d09a1d35c3
commit 760986f989

16
.bashrc
View File

@@ -6,8 +6,8 @@
# Function to append to PATH if not already present # Function to append to PATH if not already present
append_path () { append_path () {
case ":$PATH:" in case ":$PATH:" in
*:"$1":*) ;; *:"$1":*) ;; # If the given path is already in $PATH, do nothing
*) PATH="${PATH:+$PATH:}$1" ;; *) PATH="${PATH:+$PATH:}$1" ;; # Otherwise, append the given path to $PATH
esac esac
} }
@@ -17,14 +17,14 @@ append_path "$HOME/.local/bin"
append_path "$HOME/.bin" # Append .bin only if directory exists append_path "$HOME/.bin" # Append .bin only if directory exists
# Enable bash completion if available # Enable bash completion if available
if [ -f /usr/share/bash-completion/bash_completion ]; then if [ -f /usr/share/bash-completion/bash_completion ]; then # Check if bash completion script is available at the first path
. /usr/share/bash-completion/bash_completion . /usr/share/bash-completion/bash_completion # Source the bash completion script to enable autocomplete features
elif [ -f /etc/bash_completion ]; then elif [ -f /etc/bash_completion ]; then # If the first path does not exist, check the second path for the script
. /etc/bash_completion . /etc/bash_completion # Source the bash completion script from the second location
fi fi # End the conditional block
# Check if the shell is interactive, and only execute below in interactive shells # Check if the shell is interactive, and only execute below in interactive shells
[[ $- != *i* ]] && return [[ $- != *i* ]] && return # If the shell is not interactive (does not have 'i' in $-), return and do not execute further commands
# Set default aliases # Set default aliases