From 61c1899b5c5083fb974743b1f0939a9e7763f402 Mon Sep 17 00:00:00 2001 From: Bram Kelchtermans Date: Thu, 27 Jun 2024 22:22:33 +0200 Subject: [PATCH] refactor: Update starship.toml file path and add optional icon parameter in setup.sh --- setup.sh | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/setup.sh b/setup.sh index 00266dae..abf7a7c4 100644 --- a/setup.sh +++ b/setup.sh @@ -3,6 +3,41 @@ # Exit immediately if a command exits with a non-zero status. set -e +# Default icon value (empty if not provided) +icon="" + +# Function to display script usage +usage() { + echo "Usage: $0 [--icon ]" + exit 1 +} + +# Parse command-line options +while getopts ":i:-:" opt; do + case $opt in + i) + icon="$OPTARG" + ;; + -) + case "${OPTARG}" in + icon=*) + icon="${OPTARG#*=}" + ;; + *) + usage + ;; + esac + ;; + :) + echo "Option -$OPTARG requires an argument." + usage + ;; + ?) + usage + ;; + esac +done + # Function to install Fish shell install_fish() { echo "Installing Fish shell..."