From 810c8253c299eab2c58a6573e1b3e485f49258f3 Mon Sep 17 00:00:00 2001 From: Bram Kelchtermans Date: Thu, 27 Jun 2024 21:57:47 +0200 Subject: [PATCH] refactor: Update starship.toml file path and add optional icon parameter in setup.sh --- setup.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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