Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(template): propose add .local/bin to PATH #12417

Merged
merged 1 commit into from
May 16, 2024

Conversation

lifeisfoo
Copy link
Contributor

Standards checklist:

  • The PR title is descriptive.
  • The PR doesn't replicate another PR which is already open.
  • I have read the contribution guide and followed all the instructions.
  • The code follows the code style guide detailed in the wiki.
  • The code is mine or it's from somewhere with an MIT-compatible license.
  • The code is efficient, to the best of my ability, and does not waste computer resources.
  • The code is stable and I have tested it myself, to the best of my abilities.
  • If the code introduces new aliases, I provide a valid use case for all plugin users down below.

Changes:

  • fix(zshrc): added ~/.local/bin/ to PATH, as required by systemd, so user specific binaries can be found

Other comments:

The vast majority of modern Linux distributions are systemd based. User specific binaries can be now placed inside ~/.local/bin/ (SPEC).

For this reason, ~/.bashrc already adds that location to PATH. E.g. (code from a Fedora 40 brand new installation)

# User specific environment
if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]]; then
    PATH="$HOME/.local/bin:$HOME/bin:$PATH"
fi
export PATH

The vast majority of modern Linux distributions are systemd based. User specific binaries can be placed inside `~/.local/bin/` ([SPEC](https://www.freedesktop.org/software/systemd/man/latest/file-hierarchy.html#~/.local/bin/)).

For this reason, .bashrc already adds that location to PATH.
E.g. (from a Fedora 40 brand new installation)
```
# User specific environment
if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]]; then
    PATH="$HOME/.local/bin:$HOME/bin:$PATH"
fi
export PATH
```
Copy link
Member

@carlosala carlosala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@carlosala carlosala changed the title fix(zshrc): add ~/.local/bin/ to PATH as required by systemd chore(template): propose add .local/bin to PATH May 16, 2024
@carlosala carlosala merged commit a779d65 into ohmyzsh:master May 16, 2024
1 check passed
lesterchan added a commit to lesterchan/oh-my-zsh that referenced this pull request May 21, 2024
* upstream/master:
  chore(template): propose add `.local/bin` to PATH (ohmyzsh#12417)
  feat(amuse): add whitespace before virtualenv (ohmyzsh#12423)
  feat(fzf): add support for Fedora package (ohmyzsh#12421)
  feat(wd): update to version v0.6.1 (ohmyzsh#12413)
  fix(dependencies): check if repo is clean before committing
  ci(dependencies): fetch all branches
  ci(dependencies): use `setup-python` and enable cron-based jobs
  fix(dependencies): avoid creating PR if it's already there
  feat(dependencies): add support for semver tags
  fix(dependencies): improve typing
  style(dependencies): run `ruff` formatter
  chore(dependencies): update requirements.txt
  fix(fzf): fix missing `is-at-least` error in setup (ohmyzsh#12412)
wilderjds pushed a commit to wilderjds/oh-my-zsh that referenced this pull request May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants