From 70c9a949550624b9439daf5ff759a5084cfdfbe4 Mon Sep 17 00:00:00 2001
From: mehes-kth <84348450+mehes-kth@users.noreply.github.com>
Date: Mon, 24 May 2021 15:35:59 +0200
Subject: [PATCH] Reduce unnecessary complexity

---
 headstart-core.bash | 26 +++++++++++---------------
 1 file changed, 11 insertions(+), 15 deletions(-)

diff --git a/headstart-core.bash b/headstart-core.bash
index 5d7c2ef..1e45501 100644
--- a/headstart-core.bash
+++ b/headstart-core.bash
@@ -96,7 +96,6 @@ function headstart() {
       complete | env)
         # <<-CODE_NOTE: This is matched when autocompletion occurs or when using
         #               `eval "$(./headstart env -)"`
-        go_early=true
         rest+=("$1")
         ;;
       *)
@@ -121,21 +120,18 @@ function headstart() {
 
   . "$_GO_USE_MODULES" 'installation' 'aliases'
 
-  if [[ "$go_early" == 'true' ]]; then
-    case "${rest[0]}" in
-      'env')
+  case "${rest[0]}" in
+    'env')
+      @go "${rest[@]}"
+      return
+      ;;
+    'complete')
+      if [[ "$(get_installation_status)" == 'bootstrapped' ]]; then
         @go "${rest[@]}"
-        return
-        ;;
-      'complete')
-        if [[ "$(get_installation_status)" == 'bootstrapped' ]]; then
-          @go "${rest[@]}"
-        fi
-        return
-        ;;
-    esac
-  fi
-  unset go_early
+      fi
+      return
+      ;;
+  esac
 
   . "$_GO_USE_MODULES" 'system'
 
-- 
GitLab