File tree Expand file tree Collapse file tree
.github/actions/free-space-macos Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,28 +17,30 @@ runs:
1717 }
1818
1919 strip_universal_deep() {
20- opwd=$(pwd)
21- cd $1
22- f=$(find . -perm +111 -type f)
23- for fp in $f
24- do
25- if [[ $(file "$fp") == *"universal binary"* ]]; then
26- if [ "`arch`" == "arm64" ]; then
27- if [[ $(file "$fp") == *"x86_64"* ]]; then
28- sudo lipo -remove x86_64 "$fp" -o "$fp" || true
29- fi
30- else
31- if [[ $(file "$fp") == *"arm64e)"* ]]; then
32- sudo lipo -remove arm64e "$fp" -o "$fp" || true
33- fi
34- if [[ $(file "$fp") == *"arm64)"* ]]; then
35- sudo lipo -remove arm64 "$fp" -o "$fp" || true
20+ if [ -d "$1" ]; then
21+ opwd=$(pwd)
22+ cd $1
23+ f=$(find . -perm +111 -type f)
24+ for fp in $f
25+ do
26+ if [[ $(file "$fp") == *"universal binary"* ]]; then
27+ if [ "`arch`" == "arm64" ]; then
28+ if [[ $(file "$fp") == *"x86_64"* ]]; then
29+ sudo lipo -remove x86_64 "$fp" -o "$fp" || true
30+ fi
31+ else
32+ if [[ $(file "$fp") == *"arm64e)"* ]]; then
33+ sudo lipo -remove arm64e "$fp" -o "$fp" || true
34+ fi
35+ if [[ $(file "$fp") == *"arm64)"* ]]; then
36+ sudo lipo -remove arm64 "$fp" -o "$fp" || true
37+ fi
3638 fi
3739 fi
38- fi
39- done
40+ done
4041
41- cd $opwd
42+ cd $opwd
43+ fi
4244 }
4345
4446 tmpify /Library/Developer/CoreSimulator
You can’t perform that action at this time.
0 commit comments