From f4f69616ee0600348ec0a0a9d095453b436e2b60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Roberto=20S=C3=A1nchez?= Date: Mon, 24 Oct 2022 23:39:28 -0600 Subject: [PATCH 1/2] Checks if starship is already installed --- setup.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/setup.sh b/setup.sh index 86a778a..fadb91f 100755 --- a/setup.sh +++ b/setup.sh @@ -37,6 +37,12 @@ installDepend(){ } installStarship(){ + STARSHIP_CMD==$(which starship) + if [[ ! -z $STARSHIP_CMD ]]; then + echo "Starship already installed" + exit 0; + fi + if ! curl -sS https://starship.rs/install.sh|sh;then echo -e "${RED}Something went wrong during starship install!${RC}" exit 1 From 98b5b294967ab1ec818429e4c45c9bdc0ea38553 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Roberto=20S=C3=A1nchez?= Date: Mon, 24 Oct 2022 23:43:31 -0600 Subject: [PATCH 2/2] Use return instead of exit 0 --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index fadb91f..a1fd516 100755 --- a/setup.sh +++ b/setup.sh @@ -40,7 +40,7 @@ installStarship(){ STARSHIP_CMD==$(which starship) if [[ ! -z $STARSHIP_CMD ]]; then echo "Starship already installed" - exit 0; + return fi if ! curl -sS https://starship.rs/install.sh|sh;then