Skip to content

Commit 2bbec2d

Browse files
committed
Use GITHUB_ACTIONS to check
1 parent d7ff1cb commit 2bbec2d

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

components/core/tools/scripts/lib_install/macos/install-all.sh

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ curl \
1818
--location \
1919
--output "$cmake_formula_path" \
2020
--show-error \
21-
https://raw.githubusercontent.com/Homebrew/homebrew-core/b4e46db74e74a8c1650b38b1da222284ce1ec5ce\
22-
/Formula/c/cmake.rb
21+
https://raw.githubusercontent.com/Homebrew/homebrew-core/b4e46db74e74a8c1650b38b1da222284ce1ec5ce/Formula/c/cmake.rb
2322
brew install --formula "$cmake_formula_path"
2423

2524
# Install a version of `task` < 3.43 to avoid https://github.com/y-scope/clp/issues/872
@@ -29,8 +28,7 @@ curl \
2928
--location \
3029
--output "$task_formula_path" \
3130
--show-error \
32-
https://raw.githubusercontent.com/Homebrew/homebrew-core/356f8408263b6a06e8f5f83cad574773d8054e1c\
33-
/Formula/g/go-task.rb
31+
https://raw.githubusercontent.com/Homebrew/homebrew-core/356f8408263b6a06e8f5f83cad574773d8054e1c/Formula/g/go-task.rb
3432
brew install --formula "$task_formula_path"
3533

3634
rm -rf "$formula_dir"
@@ -48,25 +46,25 @@ brew install \
4846
xz \
4947
zstd
5048

51-
if [[ -n "${GITHUB_ENV}" ]]; then
49+
if [ "${GITHUB_ACTIONS:-}" == "true" ]; then
5250
LLVM_PREFIX=$(brew --prefix llvm@16)
5351
{
5452
echo "LLVM_PREFIX=$LLVM_PREFIX"
5553
echo "CC=$LLVM_PREFIX/bin/clang"
5654
echo "CXX=$LLVM_PREFIX/bin/clang++"
5755
echo "AR=$LLVM_PREFIX/bin/llvm-ar"
5856
echo "RANLIB=$LLVM_PREFIX/bin/llvm-ranlib"
59-
} >> "$GITHUB_ENV"
57+
} >>"$GITHUB_ENV"
6058
fi
6159

6260
# Install pkg-config if it isn't already installed
6361
# NOTE: We might expect that pkg-config is installed through brew, so trying to install it again
6462
# would be harmless; however, in certain environments, like the macOS GitHub hosted runner,
6563
# pkg-config is installed by other means, meaning a brew install would cause conflicts.
66-
if ! command -v pkg-config ; then
67-
brew install pkg-config
64+
if ! command -v pkg-config; then
65+
brew install pkg-config
6866
fi
6967

7068
# TODO: https://github.com/y-scope/clp/issues/795
71-
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
69+
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
7270
"${script_dir}/../check-cmake-version.sh"

0 commit comments

Comments
 (0)