<p align="center">
Add <a href="https://brew.sh"><b>Homebrew</b></a>'s shell environment to <a href="https://xon.sh"><b>xonsh</b></a> shell on <b>macOS</b>/<b>Linux</b>
<br/>
(alternative to <a href="https://docs.brew.sh/Homebrew-on-Linux">shellenv</a>).
</p>
<p align="center">
If you like the idea click ⭐ on the repo and <a href="https://twitter.com/intent/tweet?text=Nice%20xontrib%20for%20the%20xonsh%20shell!&url=https://github.com/eugenesvk/xontrib-homebrew" target="_blank">tweet</a>. This might also accelerate adding <a href="https://github.com/Homebrew/brew/pull/10757#issuecomment-791381047">xonsh support to Homebrew</a>.
</p>
## Introduction
__Homebrew__ has a `shellenv` command to add __its environment__ to your shell: it adds a few
environment variables (`HOMEBREW_` `PREFIX`/`CELLAR`/`REPOSITORY`) and updates a few paths (`MAN`/`INFO`/ `PATH`).
This xontrib automatically translates the default __bash__ export statements of `shellenv` into __xonsh__.
## Installation
To install use pip:
```bash
xpip install xontrib-homebrew
# or: xpip install -U git+https://github.com/eugenesvk/xontrib-homebrew
```
This xontrib will get loaded automatically for interactive sessions; to stop this, set
```xonsh
$XONTRIBS_AUTOLOAD_DISABLED = {"homebrew", }
```
## Usage
Add this to your xonsh run control file (`~/.xonshrc` or `~/.config/rc.xsh`):
```bash
xontrib load homebrew
```
Set custom Homebrew installation path via `$XONTRIB_HOMEBREW_PATHBREW` to `/full/path/to/bin/brew` if it's not installed at these default paths (which always take precedence):
| macOS | Linux |
|:------------------------ |:------------------------------------- |
| `/usr/local/bin/brew` | `/home/linuxbrew/.linuxbrew/bin/brew` |
| `/opt/homebrew/bin/brew` | `~/.linuxbrew/bin/brew` |
Set the level of verbosity via `$XONTRIB_HOMEBREW_LOGLEVEL` to __0–3__ (default __1__):
- 0 print nothing (fail silently)
- __1__ print errors (e.g. can't find `brew` at default locations)
- 2 print warnings (e.g issues when parsing `shellenv`)
- 3 print more verbose messages
## Known issues
- Xontrib autoload currently can't be disabled due to a [xonsh bug](https://github.com/xonsh/xonsh/issues/5020), so if you need precise control over when your environment variables are set (e.g., whether `/path/to/homebrew/bin` is at the top of `PATH`), try installing from a `deauto` branch:</br>
`xpip install -U git+https://github.com/eugenesvk/xontrib-homebrew@deauto`
- Likely due to the same bug your `$XONTRIB_HOMEBREW_PATHBREW` and `$XONTRIB_HOMEBREW_LOGLEVEL` env vars might be ignored in the autoloaded version, so install the `@deauto` version mentioned above
## Credits
This package was created with [xontrib cookiecutter template](https://github.com/xonsh/xontrib-cookiecutter).
Raw data
{
"_id": null,
"home_page": "https://github.com/eugenesvk/xontrib-homebrew",
"name": "xontrib-homebrew",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "xontrib,xonsh",
"author": "Evgeny",
"author_email": "es.bugzilla@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/ae/1f/cc27cd30bff964af80077b0a829fd0788fa6dcb1a02a71a34d3ff368ca0a/xontrib_homebrew-0.2.1.tar.gz",
"platform": null,
"description": "<p align=\"center\">\nAdd <a href=\"https://brew.sh\"><b>Homebrew</b></a>'s shell environment to <a href=\"https://xon.sh\"><b>xonsh</b></a> shell on <b>macOS</b>/<b>Linux</b>\n<br/>\n(alternative to <a href=\"https://docs.brew.sh/Homebrew-on-Linux\">shellenv</a>).\n</p>\n\n<p align=\"center\"> \nIf you like the idea click \u2b50 on the repo and <a href=\"https://twitter.com/intent/tweet?text=Nice%20xontrib%20for%20the%20xonsh%20shell!&url=https://github.com/eugenesvk/xontrib-homebrew\" target=\"_blank\">tweet</a>. This might also accelerate adding <a href=\"https://github.com/Homebrew/brew/pull/10757#issuecomment-791381047\">xonsh support to Homebrew</a>.\n</p>\n\n\n## Introduction\n\n__Homebrew__ has a `shellenv` command to add __its environment__ to your shell: it adds a few\nenvironment variables (`HOMEBREW_` `PREFIX`/`CELLAR`/`REPOSITORY`) and updates a few paths (`MAN`/`INFO`/ `PATH`).\n\nThis xontrib automatically translates the default __bash__ export statements of `shellenv` into __xonsh__.\n\n## Installation\n\nTo install use pip:\n\n```bash\nxpip install xontrib-homebrew\n# or: xpip install -U git+https://github.com/eugenesvk/xontrib-homebrew\n```\n\nThis xontrib will get loaded automatically for interactive sessions; to stop this, set\n\n```xonsh\n$XONTRIBS_AUTOLOAD_DISABLED = {\"homebrew\", }\n```\n\n## Usage\n\nAdd this to your xonsh run control file (`~/.xonshrc` or `~/.config/rc.xsh`):\n```bash\nxontrib load homebrew\n```\n\nSet custom Homebrew installation path via `$XONTRIB_HOMEBREW_PATHBREW` to `/full/path/to/bin/brew` if it's not installed at these default paths (which always take precedence):\n\n| macOS \t| Linux \t|\n|:------------------------\t|:-------------------------------------\t|\n| `/usr/local/bin/brew` \t| `/home/linuxbrew/.linuxbrew/bin/brew`\t|\n| `/opt/homebrew/bin/brew`\t| `~/.linuxbrew/bin/brew` \t|\n\nSet the level of verbosity via `$XONTRIB_HOMEBREW_LOGLEVEL` to __0\u20133__ (default __1__):\n\n - 0 print nothing (fail silently)\n - __1__ print errors (e.g. can't find `brew` at default locations)\n - 2 print warnings (e.g issues when parsing `shellenv`)\n - 3 print more verbose messages\n\n## Known issues\n\n- Xontrib autoload currently can't be disabled due to a [xonsh bug](https://github.com/xonsh/xonsh/issues/5020), so if you need precise control over when your environment variables are set (e.g., whether `/path/to/homebrew/bin` is at the top of `PATH`), try installing from a `deauto` branch:</br>\n `xpip install -U git+https://github.com/eugenesvk/xontrib-homebrew@deauto`\n- Likely due to the same bug your `$XONTRIB_HOMEBREW_PATHBREW` and `$XONTRIB_HOMEBREW_LOGLEVEL` env vars might be ignored in the autoloaded version, so install the `@deauto` version mentioned above\n\n## Credits\n\nThis package was created with [xontrib cookiecutter template](https://github.com/xonsh/xontrib-cookiecutter).\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Add Homebrew's shell environment to xonsh on macOS/Linux",
"version": "0.2.1",
"split_keywords": [
"xontrib",
"xonsh"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "76d4f5f5f30e163d403f703ebe47e27ccc06fd18f21dfa90549d8a00f7256a17",
"md5": "7ac1444aea22be5d44f349be0206987b",
"sha256": "498b30848eaaaab5b92cb9a7c571bc6303d7b40d40fe17217584defe46edde77"
},
"downloads": -1,
"filename": "xontrib_homebrew-0.2.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7ac1444aea22be5d44f349be0206987b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 4884,
"upload_time": "2023-01-28T11:16:25",
"upload_time_iso_8601": "2023-01-28T11:16:25.733121Z",
"url": "https://files.pythonhosted.org/packages/76/d4/f5f5f30e163d403f703ebe47e27ccc06fd18f21dfa90549d8a00f7256a17/xontrib_homebrew-0.2.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ae1fcc27cd30bff964af80077b0a829fd0788fa6dcb1a02a71a34d3ff368ca0a",
"md5": "140194e31d7edbdddc86efa635b7356d",
"sha256": "24a29d2c4ed27bef86acdef4d98a95254b2ad1efefae7037aed298f13713f020"
},
"downloads": -1,
"filename": "xontrib_homebrew-0.2.1.tar.gz",
"has_sig": false,
"md5_digest": "140194e31d7edbdddc86efa635b7356d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 4788,
"upload_time": "2023-01-28T11:16:26",
"upload_time_iso_8601": "2023-01-28T11:16:26.994734Z",
"url": "https://files.pythonhosted.org/packages/ae/1f/cc27cd30bff964af80077b0a829fd0788fa6dcb1a02a71a34d3ff368ca0a/xontrib_homebrew-0.2.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-01-28 11:16:26",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "eugenesvk",
"github_project": "xontrib-homebrew",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "xontrib-homebrew"
}