Skip to content

Commit 634963f

Browse files
committed
ci: ignore missing dir for strip_universal_deep
1 parent f443475 commit 634963f

1 file changed

Lines changed: 21 additions & 19 deletions

File tree

.github/actions/free-space-macos/action.yml

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)