Skip to content

Commit 526f452

Browse files
authored
Check PATH profile setup errors
1 parent 8e9b74f commit 526f452

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

scripts/install.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,12 @@ ensure_install_dir_in_path() {
266266
log_info "Added $INSTALL_DIR to PATH for this installer session"
267267
fi
268268

269-
mkdir -p "$(dirname "$PATH_PROFILE")"
270-
if ! tee "$PATH_PROFILE" > /dev/null << EOF
269+
if ! mkdir -p "$(dirname "$PATH_PROFILE")"; then
270+
log_error "Failed to create PATH profile directory: $(dirname "$PATH_PROFILE")"
271+
return 1
272+
fi
273+
274+
if ! cat > "$PATH_PROFILE" << EOF
271275
case ":\${PATH:-}:" in
272276
*:"$INSTALL_DIR":*) ;;
273277
*) export PATH="$INSTALL_DIR\${PATH:+:\$PATH}" ;;
@@ -278,7 +282,11 @@ EOF
278282
return 1
279283
fi
280284

281-
chmod 644 "$PATH_PROFILE"
285+
if ! chmod 644 "$PATH_PROFILE"; then
286+
log_error "Failed to set permissions on PATH profile: $PATH_PROFILE"
287+
return 1
288+
fi
289+
282290
log_success "Configured $INSTALL_DIR in PATH for future shell sessions"
283291
}
284292

0 commit comments

Comments
 (0)