-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathci_post_clone.sh
More file actions
executable file
·29 lines (26 loc) · 911 Bytes
/
ci_post_clone.sh
File metadata and controls
executable file
·29 lines (26 loc) · 911 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh
#
# ci_post_clone.sh - Xcode Cloud post-clone hook
#
# SPDX-License-Identifier: MIT
# Copyright (c) 2024-2025 Shawn Carrillo
#
# Bash Reference: https://tldp.org/LDP/abs/html/comparison-ops.html
# Shell options:
# set -e : Exit immediately if a command exits with a non-zero status
# Test operators:
# -n STRING : True if string is not empty
# -z STRING : True if string is empty
# -d PATH : True if path exists and is a directory
#
set -e
if [ -n "$CI" ]; then
# Install Metal Toolchain if project contains Metal shaders (required by Xcode 26+)
PROJECT_ROOT="${CI_PRIMARY_REPOSITORY_PATH:-$(dirname "$0")/..}"
if find "$PROJECT_ROOT" -maxdepth 5 -name "*.metal" | grep -q .; then
echo "note: ci_post_clone: installing Metal Toolchain"
xcodebuild -downloadComponent MetalToolchain
fi
echo "note: ci_post_clone: exec swiftlint.sh"
./swiftlint.sh
fi