From 04d6b03f6db30b797b247c7dd654afba9e2fb4ec Mon Sep 17 00:00:00 2001 From: Sean Kruzel Date: Mon, 22 Jul 2024 11:50:15 -0400 Subject: [PATCH] imporoved test coverage and installation scripts and docker for testing --- Dockerfile | 2 +- autocomplete.sh | 18 ++++++++++++++++-- docs/install.sh | 2 +- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index a514cb0..56c429d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ LABEL maintainer="sean@closedloop.tech" # Update the package list and install wget and bash RUN apt-get update && \ - apt-get install -y bash curl wget jq bash-completion vim bats && \ + apt-get install -y bash curl wget jq bc bash-completion vim bats && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* diff --git a/autocomplete.sh b/autocomplete.sh index 7067bda..7267ebf 100755 --- a/autocomplete.sh +++ b/autocomplete.sh @@ -9,7 +9,7 @@ # Do not use `set -euo pipefail` or similar because this a # bash completion script and it will change the behavior of the shell invoking it -export ACSH_VERSION=0.3.5 +export ACSH_VERSION=0.4.0 ############################################################################### # @@ -657,12 +657,26 @@ show_help() { echo "For more information, visit: https://autocomplete.sh" } +# Function to check if running in a subshell +is_subshell() { + if [[ "$$" != "$BASHPID" ]]; then + return 0 + else + return 1 + fi +} + show_config() { local config_file config_value local term_width small_table rest echo_green "Autocomplete.sh - Configuration and Settings - Version $ACSH_VERSION" - if check_if_enabled; then + + if is_subshell; then + echo -e " STATUS: \033[33;5mUnknown\033[0m \033[0m" + echo -e " Run \033[33;5msource autocomplete config\033[0m to see if autocomplete is enabled" + return + elif check_if_enabled; then # echo enabled in green echo -e " STATUS: \033[32;5mEnabled\033[0m \033[0m" else diff --git a/docs/install.sh b/docs/install.sh index bab31d1..6bbe3ec 100755 --- a/docs/install.sh +++ b/docs/install.sh @@ -4,7 +4,7 @@ # This install script downloads the latest version of the LLMs # The URL of the latest version of the LLMs -ACSH_VERSION="v0.3.4" +ACSH_VERSION="v0.4.0" BRANCH_OR_VERSION=${1:-$ACSH_VERSION} URL="https://raw.githubusercontent.com/closedloop-technologies/autocomplete-sh/${BRANCH_OR_VERSION}/autocomplete.sh"