Skip to content

Commit 9cb5083

Browse files
authored
Merge pull request #30 from unixorn/cope-with-brew-in-homedir
Add more candidate directories to be added to $PATH
2 parents 6ec5ad5 + 815ee5f commit 9cb5083

File tree

4 files changed

+30
-7
lines changed

4 files changed

+30
-7
lines changed

Diff for: .github/workflows/megalinter.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,13 @@ jobs:
4848
# Run Linter against code base #
4949
################################
5050
- name: Lint Code Base
51-
uses: nvuillam/mega-linter@v4
51+
uses: nvuillam/mega-linter@v5
5252
env:
5353
VALIDATE_ALL_CODEBASE: false
5454
DEFAULT_BRANCH: main
5555
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
DISABLE_LINTERS: SPELL_CSPELL
57+
# SPELL_MISSPELL_FILTER_REGEX_EXCLUDE: '(\.yml)'
5658

5759
# Upload Mega-Linter artifacts. They will be available on Github action page "Artifacts" section
5860
- name: Archive production artifacts

Diff for: Changelog.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,14 @@
2424

2525
## 1.3.2
2626

27-
- Swiftbar started capturing `stderr` in addition to `stdout`, causing log messages to spam the menu bar. Default to log level critical so we don't spam log messages (that no one was seeing anyway) except when we're testing.
27+
- Swiftbar started capturing `stderr` in addition to `stdout`, causing log messages to spam the menu bar. Default to log level critical so we don't spam log messages (that no one was seeing anyway) except when we're testing.
28+
29+
## 1.3.3
30+
31+
dd more candidate directories to be added to $PATH
32+
33+
- Check for `~/homebrew/bin` and `~/homebrew/sbin` to cope when homebrew
34+
is installed in a user's home directory. Closes https://github.com/unixorn/lima-xbar-plugin/issues/28
35+
- While we're in there, check for `/usr/local/sbin`,
36+
`/opt/homebrew/sbin`, `/opt/local/sbin`, `~/bin` and `~/sbin`
37+
directories too.

Diff for: lima-plugin

+15-4
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ RUNNING_VM_COLOR = "#29cc00"
3434
# Stopped VM color (default red)
3535
STOPPED_VM_COLOR = "#ff0033"
3636

37-
VERSION = "1.3.2"
37+
VERSION = "1.3.3"
3838

3939

4040
def logSetup(level: str = "INFO"):
@@ -270,15 +270,26 @@ def prep_environment_for_lima(vm: str = "default", env: dict = dict(os.environ))
270270
"""
271271
Set up an environment dictionary we can use to run a lima command.
272272
273-
Also adds /usr/local/bin, /opt/homebrew/bin and /opt/local/bin to $PATH
274-
if they exist and are directories.
273+
Also adds /usr/local/{s}bin, /opt/homebrew/{s}bin, /opt/local/{s}bin,
274+
~/homebrew/{s}bin and ~/{s}bin to $PATH if they exist and are directories.
275275
276276
:param str vm: VM to work in
277277
:param dict env: Environment variables to base returned environment on
278278
279279
:return dict: Environment dictionary, with extra bindirs added to $PATH
280280
"""
281-
extrapaths = ["/usr/local/bin", "/opt/homebrew/bin", "/opt/local/bin"]
281+
extrapaths = [
282+
"/opt/homebrew/bin",
283+
"/opt/homebrew/sbin",
284+
"/opt/local/bin",
285+
"/opt/local/sbin",
286+
"/usr/local/bin",
287+
"/usr/local/sbin",
288+
f"{os.environ.get('HOME')}/bin",
289+
f"{os.environ.get('HOME')}/homebrew/bin",
290+
f"{os.environ.get('HOME')}/homebrew/sbin",
291+
f"{os.environ.get('HOME')}/sbin",
292+
]
282293
for p in extrapaths:
283294
if os.path.isdir(p):
284295
logging.info("Adding %s to $PATH", p)

Diff for: pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "lima-plugin"
3-
version = "0.1.0"
3+
version = "1.3.3"
44
description = "Xbar and Swiftbar plugin to control lima"
55
authors = ["Joe Block <[email protected]>"]
66
license = "Apache 2.0"

0 commit comments

Comments
 (0)