From 162bdf36095a9bbd4710d85f2562b3eff2eeb0b1 Mon Sep 17 00:00:00 2001 From: RoseSecurity Date: Thu, 19 Mar 2026 15:00:58 -0400 Subject: [PATCH] fix: correct syntax errors and typos in shell scripts - Fix DEBAIN_DATECODE typo to DEBIAN_DATECODE in Dockerfile - Fix malformed brace in bold variable check: "$bold"} -> "$bold" - Fix path comparison logic in file_on_host function - Quote KUBECONFIG variable in helm.sh for safety - Add missing $ prefix to GEODESIC_TF_PROMPT_ENABLED variable --- os/debian/Dockerfile.debian | 4 ++-- rootfs/etc/profile.d/_10-colors.sh | 2 +- rootfs/etc/profile.d/_50-workspace.sh | 2 +- rootfs/etc/profile.d/helm.sh | 4 ++-- rootfs/etc/profile.d/prompt.sh | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/os/debian/Dockerfile.debian b/os/debian/Dockerfile.debian index e029b561b..c0f00683a 100644 --- a/os/debian/Dockerfile.debian +++ b/os/debian/Dockerfile.debian @@ -5,7 +5,7 @@ # bookworm-20241016 corresponds to Debian 12.7 ARG DEBIAN_CODENAME=bookworm # Debian codenamed images are tagged with date codes rather than minor version numbers. -ARG DEBAIN_DATECODE=20241223 +ARG DEBIAN_DATECODE=20241223 # Find the current version of Python at https://www.python.org/downloads/source/ ARG PYTHON_VERSION=3.12.8 @@ -61,7 +61,7 @@ RUN find / -xdev -name __pycache__ -exec rm -rf {} \; -prune # # Geodesic base image # -FROM debian:${DEBIAN_CODENAME}-${DEBAIN_DATECODE}-slim +FROM debian:${DEBIAN_CODENAME}-${DEBIAN_DATECODE}-slim ARG VERSION ENV GEODESIC_VERSION=$VERSION diff --git a/rootfs/etc/profile.d/_10-colors.sh b/rootfs/etc/profile.d/_10-colors.sh index fe247c0d1..101d098ad 100755 --- a/rootfs/etc/profile.d/_10-colors.sh +++ b/rootfs/etc/profile.d/_10-colors.sh @@ -210,7 +210,7 @@ function _geodesic_tput_cache_init() { done # Bold is not a color, handle bold without color change separately - if [[ -n "$bold"} ]]; then + if [[ -n "$bold" ]]; then _geodesic_tput_cache["bold"]=$(printf "\x01%s\x02" "$bold") _geodesic_tput_cache["bold-off"]=$(printf "\x01%s\x02" "$bold_off") fi diff --git a/rootfs/etc/profile.d/_50-workspace.sh b/rootfs/etc/profile.d/_50-workspace.sh index f1265cc75..2f79dc486 100644 --- a/rootfs/etc/profile.d/_50-workspace.sh +++ b/rootfs/etc/profile.d/_50-workspace.sh @@ -14,7 +14,7 @@ function file_on_host() { for path in "${GEODESIC_HOST_PATHS[@]}"; do # Skip paths that are just slashes, or completely empty, which would match everything [[ "$path" =~ ^/*$ ]] && continue - if [[ "$path" == "${file}/" || "${file}" == "$path"* ]]; then + if [[ "${file}" == "${path}" || "${file}" == "$path"* ]]; then return 0 fi done diff --git a/rootfs/etc/profile.d/helm.sh b/rootfs/etc/profile.d/helm.sh index 5ea0a71e7..dd20d5e10 100644 --- a/rootfs/etc/profile.d/helm.sh +++ b/rootfs/etc/profile.d/helm.sh @@ -1,8 +1,8 @@ if command -v helm >/dev/null; then # Initialize auto-completion for whichever helm version is the installed default # Suppress error message about KUBECONFIG not found or being world readable - if [[ -r $KUBECONFIG ]]; then - chmod 600 $KUBECONFIG + if [[ -r "$KUBECONFIG" ]]; then + chmod 600 "$KUBECONFIG" source <(helm completion bash) else touch /tmp/kubecfg diff --git a/rootfs/etc/profile.d/prompt.sh b/rootfs/etc/profile.d/prompt.sh index 2b091423b..a47cb1543 100755 --- a/rootfs/etc/profile.d/prompt.sh +++ b/rootfs/etc/profile.d/prompt.sh @@ -168,7 +168,7 @@ function geodesic_prompt() { if [[ -n ${GEODESIC_TF_PROMPT_LINE} ]]; then tf_prompt=" ${tf_mark} ${GEODESIC_TF_PROMPT_LINE}\n" fi - if [[ GEODESIC_TF_PROMPT_ENABLED == "true" ]]; then + if [[ $GEODESIC_TF_PROMPT_ENABLED == "true" ]]; then KUBE_PS1_PREFIX="$(yellow-n "cluster:")(" fi fi