mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-05-29 04:53:17 +02:00
Merge 94a01ee607 into 0eecd2821e
This commit is contained in:
commit
9c4671524f
2 changed files with 10 additions and 1 deletions
|
|
@ -6,7 +6,9 @@ import argparse
|
||||||
|
|
||||||
def parse(line):
|
def parse(line):
|
||||||
left = line[0:line.find('=')].strip()
|
left = line[0:line.find('=')].strip()
|
||||||
right = line[line.find('=')+1:].strip('\'"\n ')
|
right = line[line.find('=')+1:].strip('\n ')
|
||||||
|
if len(right) >= 2 and right[0] == right[-1] and right[0] in '\'"':
|
||||||
|
right = right[1:-1]
|
||||||
try:
|
try:
|
||||||
cmd = next(part for part in right.split() if len([char for char in '=<>' if char in part])==0)
|
cmd = next(part for part in right.split() if len([char for char in '=<>' if char in part])==0)
|
||||||
except StopIteration:
|
except StopIteration:
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,13 @@ if [[ -z "$HOMEBREW_PREFIX" ]]; then
|
||||||
export HOMEBREW_PREFIX="$(brew --prefix)"
|
export HOMEBREW_PREFIX="$(brew --prefix)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Ensure Homebrew's sbin directory is in PATH, as brew shellenv may not always
|
||||||
|
# be sourced (e.g. when brew is already on PATH from a prior shellenv call).
|
||||||
|
# This avoids "Homebrew's sbin was not found in your PATH" warnings.
|
||||||
|
if [[ -d "$HOMEBREW_PREFIX/sbin" ]] && [[ ":$PATH:" != *":$HOMEBREW_PREFIX/sbin:"* ]]; then
|
||||||
|
export PATH="$HOMEBREW_PREFIX/sbin:$PATH"
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -d "$HOMEBREW_PREFIX/share/zsh/site-functions" ]]; then
|
if [[ -d "$HOMEBREW_PREFIX/share/zsh/site-functions" ]]; then
|
||||||
fpath+=("$HOMEBREW_PREFIX/share/zsh/site-functions")
|
fpath+=("$HOMEBREW_PREFIX/share/zsh/site-functions")
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue