22 lines
570 B
Bash
22 lines
570 B
Bash
|
|
#!/bin/bash
|
|||
|
|
|
|||
|
|
target="$HOME/.bashrc"
|
|||
|
|
|
|||
|
|
config_dir="$HOME/.config/prompt-theme"
|
|||
|
|
config_file="$config_dir/config.yaml"
|
|||
|
|
source_line="source $config_dir/bin/prompt-theme.sh"
|
|||
|
|
|
|||
|
|
if ! grep -Fxq "$source_line" "$target"; then
|
|||
|
|
echo "$source_line" >> "$target"
|
|||
|
|
echo "✅ Added prompt-theme to $target"
|
|||
|
|
else
|
|||
|
|
echo "ℹ️ prompt-theme is already sourced in $target"
|
|||
|
|
fi
|
|||
|
|
|
|||
|
|
# copy default config file if none exists
|
|||
|
|
if [[ ! -f "$config_file" ]]; then
|
|||
|
|
cp "$config_dir/share/_config.yaml" "$config_file"
|
|||
|
|
else
|
|||
|
|
echo "ℹ️ Existing config.yaml found at $config_file (unchanged)"
|
|||
|
|
fi
|