@@ -256,7 +256,10 @@ install_binary() {
256256 log_success " Binary installed to $INSTALL_DIR /aks-flex-node"
257257}
258258
259- ensure_install_dir_in_path () {
259+ configure_install_dir_path () {
260+ local profile_dir
261+ profile_dir=$( dirname " $PATH_PROFILE " )
262+
260263 if [[ " :${PATH:- } :" != * " :$INSTALL_DIR :" * ]]; then
261264 if [[ -n " ${PATH:- } " ]]; then
262265 export PATH=" $INSTALL_DIR :$PATH "
@@ -266,8 +269,8 @@ ensure_install_dir_in_path() {
266269 log_info " Added $INSTALL_DIR to PATH for this installer session"
267270 fi
268271
269- if ! mkdir -p " $( dirname " $PATH_PROFILE " ) " ; then
270- log_error " Failed to create PATH profile directory: $( dirname " $PATH_PROFILE " ) "
272+ if ! mkdir -p " $profile_dir " ; then
273+ log_error " Failed to create PATH profile directory: $profile_dir "
271274 return 1
272275 fi
273276
@@ -278,7 +281,7 @@ case ":\${PATH:-}:" in
278281esac
279282EOF
280283 then
281- log_error " Failed to configure $INSTALL_DIR in PATH : $PATH_PROFILE "
284+ log_error " Failed to write PATH profile to : $PATH_PROFILE "
282285 return 1
283286 fi
284287
@@ -590,7 +593,7 @@ main() {
590593
591594 # Install binary
592595 install_binary " $binary_path "
593- ensure_install_dir_in_path
596+ configure_install_dir_path
594597
595598 # Setup service components
596599 install_azure_cli
0 commit comments