_env.sh 1.0 KB

1234567891011121314151617181920
  1. # _env.sh - PATH self-heal sourced by every fleetflow entry script.
  2. #
  3. # WHY: GUI-launched hosts (Claude Desktop et al.) snapshot their environment
  4. # at app start, so User-PATH entries added later by installers (winget, npm,
  5. # scoop, pipx, uv) are invisible to child shells until the host restarts.
  6. # Sessions then fail with "claude/jq/keyring not found" despite correct
  7. # installs. This block re-adds the canonical per-user tool dirs when present.
  8. # Extend via FLEETFLOW_PATH_PREPEND (colon-separated) for exotic locations.
  9. for _ffd in ${FLEETFLOW_PATH_PREPEND:+$(echo "$FLEETFLOW_PATH_PREPEND" | tr ':' ' ')} \
  10. "$HOME/.local/bin" \
  11. "$HOME/AppData/Local/Microsoft/WinGet/Links" \
  12. "$HOME/AppData/Roaming/npm" \
  13. "$HOME/scoop/shims" \
  14. "$HOME/AppData/Local/Programs/Python/Python313/Scripts" \
  15. "$HOME/AppData/Roaming/Python/Python313/Scripts" \
  16. "$HOME/.local/share/uv/tools" ; do
  17. [ -d "$_ffd" ] && case ":$PATH:" in *":$_ffd:"*) ;; *) PATH="$_ffd:$PATH" ;; esac
  18. done
  19. unset _ffd
  20. export PATH