Files
apk/dist/init_rc.sh
anorien90 25fdc285d3
Some checks failed
Test setup and build APKs archlinux / Build-APK-Arch-Linux (push) Failing after 6m41s
Test setup and build APKs / Build-and-Create-Development-Environment (push) Successful in 12s
fixed init_rc and added it to general setup
2025-12-09 16:43:27 +01:00

26 lines
628 B
Bash

#!/bin/bash
# detect if either .bashrc or .zshrc is present
if [ -f "$HOME/.bashrc" ]; then
SHELL_RC="$HOME/.bashrc"
elif [ -f "$HOME/.zshrc" ]; then
SHELL_RC="$HOME/.zshrc"
else
touch "$HOME/.bashrc"
SHELL_RC="$HOME/.bashrc"
fi
echo "Using shell rc file: $SHELL_RC"
# Check if content already exists in the shell rc file and if not, append it
if ! grep -q "export PATH=\$PATH:\$HOME/.local/bin" "$SHELL_RC"; then
echo "Adding .local/bin to PATH in $SHELL_RC"
echo 'export PATH=$PATH:$HOME/.local/bin' >> "$SHELL_RC"
else
echo ".local/bin is already in PATH in $SHELL_RC"
fi
source "$SHELL_RC"