prompt-themes/bin/install.sh
2025-05-05 16:06:10 +03:00

21 lines
570 B
Bash
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/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