File tree 2 files changed +6
-26
lines changed
2 files changed +6
-26
lines changed Original file line number Diff line number Diff line change 25
25
"$prefix/sbin" "$prefix/share" "$prefix/var" "$prefix/Library/Taps"
26
26
echo 'EOF'
27
27
} >>"$GITHUB_OUTPUT"
28
- echo version=$(brew --version | sed -n '1{s /[<>:"\/\\|?*[:space:]] /_/g;p} ') >> "$GITHUB_OUTPUT"
28
+ echo version=$(brew --version | sed -e '1s /[<>:"\/\\|?* \t] /_/g' -e '2,$d ') >> "$GITHUB_OUTPUT"
29
29
- name : Cache lookup
30
30
id : cache_lookup
31
31
uses : actions/cache/restore@v4
Original file line number Diff line number Diff line change 9
9
shell : bash
10
10
run : |
11
11
# Linuxbrew
12
- if [ -x /home/linuxbrew/.linuxbrew/bin/brew ]; then
13
- eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
12
+ for path in "/home/linuxbrew/.linuxbrew/bin" "/opt/homebrew/bin" "/usr/local/bin";do
13
+ if [ -x "$path/brew" ]; then
14
+ eval "$("$path/brew" shellenv)"
15
+ echo "$path/brew" >>"$GITHUB_PATH"
16
+ fi
14
17
fi
15
- # macOS Apple Silicon
16
- if [ -x /opt/homebrew/bin/brew ]; then
17
- eval "$(/opt/homebrew/bin/brew shellenv)"
18
- fi
19
- # macOS Intel
20
- if [ -x /usr/local/bin/brew ]; then
21
- eval "$(/usr/local/bin/brew shellenv)"
22
- fi
23
-
24
- if ! command -v brew >/dev/null; then
25
- echo "::error::brew not found"
26
- exit 1
27
- fi
28
-
29
- # Persist any new PATH entries for later steps
30
- ORIGINAL_PATH="$PATH"
31
- IFS=':' read -ra NEW_PARTS <<<"$PATH"
32
- for p in "${NEW_PARTS[@]}"; do
33
- case ":$ORIGINAL_PATH:" in
34
- *":$p:"*) ;; # already present
35
- *) echo "$p" >>"$GITHUB_PATH" ;;
36
- esac
37
- done
38
18
39
19
# Keep HOMEBREW variables
40
20
echo "HOMEBREW_PREFIX=$(brew --prefix)" >> "$GITHUB_ENV"
You can’t perform that action at this time.
0 commit comments