-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpod-install
executable file
·37 lines (31 loc) · 1.03 KB
/
pod-install
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
30
31
32
33
34
35
36
37
#!/bin/zsh
# https://github.com/b9swift/CI-System
# Copyright (c) 2024 BB9z, MIT License
#
# Smart pod install, runs when needed
set -euo pipefail
. "$(dirname "$0")/lib/foundation.sh"
. "$(dirname "$0")/lib/log.sh"
if [[ -z "${CI_POD_INSTALL_LOG_FILE:-}" ]]; then
CI_POD_INSTALL_LOG_FILE="build/pod_install.log"
fi
prepeareResultFile "$CI_POD_INSTALL_LOG_FILE"
logInfo "[CocoaPods] Installing dependencies..."
LANG=en_US.UTF-8
isNeedsPodInstall=false
diff "Podfile.lock" "Pods/Manifest.lock" 2>/dev/null || {
isNeedsPodInstall=true
}
if $isNeedsPodInstall; then
pod install > "$CI_POD_INSTALL_LOG_FILE" 2>&1 || {
logWarning "[CocoaPods] Installation failed, trying to update the spec repo."
pod install --repo-update --verbose > "$CI_POD_INSTALL_LOG_FILE" 2>&1
} || {
logError "[CocoaPods] Installation failed:"
cat "$CI_POD_INSTALL_LOG_FILE"
exit 1
}
else
logInfo "[CocoaPods] Installation skipped, lock files match local cache."
fi
logInfo "[CocoaPods] Installation completed."