Skip to content

Commit 21ff1e5

Browse files
authored
Clarify PATH profile setup
1 parent 526f452 commit 21ff1e5

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

scripts/install.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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
278281
esac
279282
EOF
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

Comments
 (0)