Last active
July 23, 2023 13:15
-
-
Save dimohamdy/208e7215b56a4f5b294be4473715adf2 to your computer and use it in GitHub Desktop.
Script for Xcode build stage to list the unused code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if ! command -v periphery &> /dev/null; then | |
echo "โ Periphery is not installed. Please install periphery before running this script." | |
else | |
cd .. # change the current directory | |
check_unused_codes_script="${SRCROOT}/../check-unused-codes.sh" | |
sorted_result=$("$check_unused_codes_script") | |
result_with_removed_code_line_number=$(echo "$sorted_result" | sed "s|:[0-9]+:[0-9]+:|:|") | |
IFS=$'\n' read -rd '' -a lines <<< "$result_with_removed_code_line_number" | |
for line in "${lines[@]}"; do | |
echo "${SRCROOT}/../$line" | |
done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment