From fd338b60f626f6408871f4780e8ce24942da99a7 Mon Sep 17 00:00:00 2001 From: Aaron Fiore Date: Tue, 12 Aug 2025 10:31:37 -0700 Subject: [PATCH 1/4] client: docker/lib_docker: make fatal for unsupported platform --- client/src/docker/docker.bash | 4 ++-- client/src/docker/lib/lib_docker.bash | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/client/src/docker/docker.bash b/client/src/docker/docker.bash index 2e94b16..a832e0c 100755 --- a/client/src/docker/docker.bash +++ b/client/src/docker/docker.bash @@ -2,7 +2,7 @@ # docker-finance | modern accounting for the power-user # -# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC) +# Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -52,7 +52,7 @@ function main() - platform \e[34;3mBase image platform (default: archlinux)\e[0m + platform \e[34;3mBase image platform (archlinux | ubuntu | dev-tools)\e[0m user \e[34;3mUser to bind-mount with (default: ${USER})\e[0m tag \e[34;3mImage tag type to use (default: latest)\e[0m diff --git a/client/src/docker/lib/lib_docker.bash b/client/src/docker/lib/lib_docker.bash index 1f1fb0f..345c5ec 100644 --- a/client/src/docker/lib/lib_docker.bash +++ b/client/src/docker/lib/lib_docker.bash @@ -2,7 +2,7 @@ # docker-finance | modern accounting for the power-user # -# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC) +# Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -81,8 +81,7 @@ function lib_docker::docker() lib_utils::print_debug "global_platform=${global_platform}" if [[ ! "$global_platform" =~ ^archlinux$|^ubuntu$|^dev-tools$ ]]; then - lib_utils::print_warning "unsupported platform '${global_platform}', defaulting to Arch Linux" - global_platform="archlinux" + lib_utils::die_fatal "Unsupported platform '${global_platform}'" fi # Parse tag From 38391e03c7ef4e072a5ef96e30479d95f2b7f590 Mon Sep 17 00:00:00 2001 From: Aaron Fiore Date: Tue, 12 Aug 2025 10:32:12 -0700 Subject: [PATCH 2/4] client: lib_env: fix handling of global command --- client/src/docker/lib/internal/lib_env.bash | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/client/src/docker/lib/internal/lib_env.bash b/client/src/docker/lib/internal/lib_env.bash index e957cf7..9b085ea 100644 --- a/client/src/docker/lib/internal/lib_env.bash +++ b/client/src/docker/lib/internal/lib_env.bash @@ -2,7 +2,7 @@ # docker-finance | modern accounting for the power-user # -# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC) +# Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -120,12 +120,10 @@ function lib_env::env() lib_env::__write "$_env_file" fi else - [ -z "$global_command" ] && lib_utils::die_fatal - [ -z "$global_basename" ] && lib_utils::die_fatal - - if [[ -z "$global_command" || "$global_command" != "gen" ]]; then + # shellcheck disable=SC2154 + if [ "$global_command" != "gen" ]; then lib_utils::die_fatal \ - "Client environment not found! Run gen command'" + "Client environment not found! Run 'gen' command" fi lib_utils::print_info \ From c2789f54db4b60f478d006b17c3d194e6ccdfea8 Mon Sep 17 00:00:00 2001 From: Aaron Fiore Date: Tue, 12 Aug 2025 10:42:42 -0700 Subject: [PATCH 3/4] client: docker: don't make fatal for empty/invalid command --- client/src/docker/docker.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/docker/docker.bash b/client/src/docker/docker.bash index a832e0c..7bfd087 100755 --- a/client/src/docker/docker.bash +++ b/client/src/docker/docker.bash @@ -167,7 +167,7 @@ function main() # Command facade # - [ -z "$global_command" ] && lib_utils::die_fatal + # shellcheck disable=SC2154 case "$global_command" in gen) lib_docker::gen "${@:3}" From 8fed7f8c54cf113b5868a5cdb3dc4382606e14db Mon Sep 17 00:00:00 2001 From: Aaron Fiore Date: Tue, 12 Aug 2025 11:01:01 -0700 Subject: [PATCH 4/4] client: lib_docker: make fatal if user not given --- client/src/docker/lib/lib_docker.bash | 1 + 1 file changed, 1 insertion(+) diff --git a/client/src/docker/lib/lib_docker.bash b/client/src/docker/lib/lib_docker.bash index 345c5ec..dc11495 100644 --- a/client/src/docker/lib/lib_docker.bash +++ b/client/src/docker/lib/lib_docker.bash @@ -78,6 +78,7 @@ function lib_docker::docker() IFS="/" read -ra _image <<<"$1" declare -gx global_platform="${_image[0]}" local -r _user="${_image[1]}" + [ -z "$_user" ] && lib_utils::die_fatal "User not given for '${_image[*]}'" lib_utils::print_debug "global_platform=${global_platform}" if [[ ! "$global_platform" =~ ^archlinux$|^ubuntu$|^dev-tools$ ]]; then