From 5609704b25ea7b0e9774487f310c94b8ca33cf8b Mon Sep 17 00:00:00 2001 From: Aaron Fiore Date: Tue, 30 Jul 2024 17:22:11 -0700 Subject: [PATCH] bash: lib_fetch: create prices dir if nonexistent --- container/src/finance/lib/internal/lib_fetch.bash | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/container/src/finance/lib/internal/lib_fetch.bash b/container/src/finance/lib/internal/lib_fetch.bash index 4b35275..92eff72 100644 --- a/container/src/finance/lib/internal/lib_fetch.bash +++ b/container/src/finance/lib/internal/lib_fetch.bash @@ -660,7 +660,9 @@ function lib_fetch::__fetch_price() # Prices master file # NOTE: base dir of all price files (subdirs will be by year) - local _master_prices="${global_child_profile_flow}/prices/master.prices" + local -r _prices_dir="${global_child_profile_flow}/prices" + [ ! -d "$_prices_dir" ] && mkdir -p "$_prices_dir" + local -r _master_prices="${_prices_dir}/master.prices" for _api in "${_arg_api[@]}"; do