diff --git a/setup.sh b/setup.sh index 03ff8269..c53eb8f8 100644 --- a/setup.sh +++ b/setup.sh @@ -33,17 +33,18 @@ configure_starship() { overwrite_starship_toml() { local icon="$1" local starship_toml_path="./terminal/starship.toml" + local destination_path="$HOME/.config/starship.toml" if [ -f "$starship_toml_path" ]; then echo "Overwriting starship.toml..." - mkdir -p ~/.config/starship # Insert icon before hostname if provided if [ -n "$icon" ]; then sed -i "s/format = \"\"\"/format = \"\"\"\[ $icon \](fg:color_fg0)\\n/" "$starship_toml_path" fi - cp "$starship_toml_path" ~/.config/starship/starship.toml + mkdir -p $(dirname "$destination_path") + cp "$starship_toml_path" "$destination_path" else echo "starship.toml not found in the repository." exit 1