From 1b7262c0cde330fadbee7127d9023d849488a287 Mon Sep 17 00:00:00 2001 From: fatalerrors Date: Thu, 26 Mar 2026 15:12:18 +0100 Subject: [PATCH] few minor update fix --- profile.d/updates.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/profile.d/updates.sh b/profile.d/updates.sh index 1f13c48..f0a99c9 100644 --- a/profile.d/updates.sh +++ b/profile.d/updates.sh @@ -97,6 +97,7 @@ check_updates() unset lastver vfile return $result } +export -f check_updates # ------------------------------------------------------------------------------ @@ -141,15 +142,17 @@ profile_upgrade() if [[ -d $MYPATH/.git ]]; then disp I "Git installation detected, applying git pull." - local curdir=$(pwd) - cd $MYPATH + pushd "$MYPATH" || { + disp E "Failed to change directory to $MYPATH." + return 3 + } git pull || { disp E "Git pull failed, upgrade not applyed." - cd "$curdir" + popd return 2 } disp I "Successfully upgraded using git." - cd "$curdir" + popd else disp I "No Git detected. Downloading and applying upgrade from archive..." local tmpdir="/tmp/profile_upg.$$" @@ -182,6 +185,7 @@ profile_upgrade() rm -rf "$tmpdir" fi } +export -f profile_upgrade # ------------------------------------------------------------------------------