From 64cb3713aee93fb5261f4968baba332f377fac5d Mon Sep 17 00:00:00 2001 From: bmaltais Date: Fri, 23 Jun 2023 17:10:20 -0400 Subject: [PATCH] More updates --- gui.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gui.sh b/gui.sh index 91c75e08d..a85f91eea 100755 --- a/gui.sh +++ b/gui.sh @@ -1,5 +1,15 @@ #!/usr/bin/env bash +# Checks to see if variable is set and non-empty. +# This is defined first, so we can use the function for some default variable values +env_var_exists() { + if [[ -n "${!1}" ]]; then + return 0 + else + return 1 + fi +} + # Need RUNPOD to have a default value before first access RUNPOD=false if env_var_exists RUNPOD_POD_ID || env_var_exists RUNPOD_API_KEY; then