@@ -1,29 +1,7 @@
11 #!/usr/bin/env bash
2-# Install shell config by appending a source line to ~/.bashrc (or ~/.zshrc).
3-# The full bashrc is kept here for reference; the installer sources shared.sh
4-# so it works alongside an existing rc file.
52 set -euo pipefail
63
7-repo_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
8-config_dir="${XDG_CONFIG_HOME:-$HOME/.config}/shell"
4+script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
95
10-mkdir -p "$config_dir"
11-
12-# Link shared.sh
13-target="$config_dir/shared.sh"
14-if [ ! -e "$target" ] && [ ! -L "$target" ]; then
15- ln -s "$repo_dir/shared.sh" "$target"
16-fi
17-
18-source_line='[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shared.sh" ] && . "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shared.sh"'
19-
20-for rc_file in "$HOME/.zshrc" "$HOME/.bashrc"; do
21- if [ -f "$rc_file" ]; then
22- if ! grep -q "shell/shared.sh" "$rc_file"; then
23- printf '\n# Load shared shell config\n%s\n' "$source_line" >> "$rc_file"
24- fi
25- fi
26-done
27-
28-echo "Installed shell config."
29-echo "A full reference bashrc is in: $repo_dir/bashrc"
6+cp "$script_dir/bashrc" "$HOME/.bashrc"
7+echo "Installed $script_dir/bashrc -> $HOME/.bashrc"