Skip to content

Commit 585f2fa

Browse files
committed
quarantine work
1 parent 477d7a5 commit 585f2fa

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ jobs:
1818
steps:
1919
- name: asdf_plugin_test
2020
uses: asdf-vm/actions/plugin-test@v1
21+
env:
22+
ASDF_CLANG_TOOLS_MACOS_DEQUARANTINE: 1
2123
with:
2224
plugin: clang-format
2325
command: clang-format --version

lib/utils.bash

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
set -euo pipefail
44

5-
# TODO: Ensure this is the correct GitHub homepage where releases can be downloaded for clang-tools-static.
5+
# Settings
6+
ASDF_CLANG_TOOLS_MACOS_DEQUARANTINE=${ASDF_CLANG_TOOLS_MACOS_DEQUARANTINE:-0}
7+
68
GH_REPO="muttleyxd/clang-tools-static-binaries"
79
GH_REPO_URL="https://github.com/${GH_REPO}"
810
PLUGIN_NAME="clang-tools-static"
@@ -167,14 +169,20 @@ install_version() {
167169
ln -s "${asset_path}/${full_tool_cmd}" "$install_path/bin/$tool_cmd"
168170

169171
if [ "$USE_KERNEL" == "macosx" ]; then
170-
log "$toolname needs to be un-quarantined to run:\n\n"
171-
echo -e " xattr -dr com.apple.quarantine \"${asset_path}/${full_tool_cmd}\""
172-
echo -e -n "\n\nProceed? [y/N] "
173-
read -r reply
174-
if [[ $reply =~ $YES_REGEX ]]; then
175-
xattr -dr com.apple.quarantine "${asset_path}/${full_tool_cmd}"
176-
else
177-
exit 1
172+
if [ "$ASDF_CLANG_TOOLS_MACOS_DEQUARANTINE" != 1 ]; then
173+
log "$toolname needs to be de-quarantined to run:\n\n"
174+
echo -e " xattr -dr com.apple.quarantine \"${asset_path}/${full_tool_cmd}\""
175+
echo -e -n "\n\nProceed? [y/N] "
176+
read -r reply
177+
if [[ $reply =~ $YES_REGEX ]]; then
178+
ASDF_CLANG_TOOLS_MACOS_DEQUARANTINE=1
179+
else
180+
exit 1
181+
fi
182+
183+
if [ "$ASDF_CLANG_TOOLS_MACOS_DEQUARANTINE" == 1 ]; then
184+
xattr -dr com.apple.quarantine "${asset_path}/${full_tool_cmd}"
185+
fi
178186
fi
179187
fi
180188

0 commit comments

Comments
 (0)