-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsafeditool.sh
executable file
·33 lines (28 loc) · 948 Bytes
/
safeditool.sh
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
#!/bin/zsh
set -e
VERSION='1.1.0'
SAFEDI_LOCATION="$BUILD_DIR/SafeDITool-Release/$VERSION/safeditool"
# Download the tool from Github releases.
if [ -f "$SAFEDI_LOCATION" ]; then
if [ ! -x "$SAFEDI_LOCATION" ]; then
chmod +x "$SAFEDI_LOCATION"
fi
else
mkdir -p "$(dirname "$SAFEDI_LOCATION")"
ARCH=$(uname -m)
if [ "$ARCH" = "arm64" ]; then
ARCH_PATH="SafeDITool-arm64"
elif [ "$ARCH" = "x86_64" ]; then
ARCH_PATH="SafeDITool-x86_64"
else
echo "Unsupported architecture: $ARCH"
exit 1
fi
curl -L -o "$SAFEDI_LOCATION" "https://github.com/dfed/SafeDI/releases/download/$VERSION/$ARCH_PATH"
chmod +x "$SAFEDI_LOCATION"
fi
# Run the tool.
SOURCE_DIR="$PROJECT_DIR/ExampleCocoaPodsIntegration"
SAFEDI_OUTPUT="$PROJECT_DIR/SafeDIOutput/SafeDI.swift"
mkdir -p $PROJECT_DIR/SafeDIOutput
$SAFEDI_LOCATION --include "$SOURCE_DIR" --dependency-tree-output "$SAFEDI_OUTPUT"