File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
271275case ":\$ {PATH:-}:" in
272276 *:"$INSTALL_DIR ":*) ;;
273277 *) export PATH="$INSTALL_DIR \$ {PATH:+:\$ PATH}" ;;
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
You can’t perform that action at this time.
0 commit comments