resgen.swift/scripts/swiftly-clean.sh
2021-12-10 09:47:55 +01:00

17 lines
534 B
Bash
Executable File

#!/bin/bash
set -e
if [[ "$BUILD_DIR" == *"IBDesignables"* ]] || [[ "$BUILD_DIR" == *"Previews"* ]] ; then
echo "do nothing when building for IBDesignables/SwiftUI Previews builds";
exit 0
fi
if [[ -z ${SKIP_SWIFTCLEAN} || ${SKIP_SWIFTCLEAN} != 1 ]]; then
if [[ -d "${LOCAL_APPS_DIR}/Swiftly-Clean.app" ]]; then
"${LOCAL_APPS_DIR}"/Swiftly-Clean.app/Contents/Resources/SwiftClean.app/Contents/MacOS/SwiftClean "${SRCROOT}"
else
echo "warning: You have to install and set up Swift-Clean to use its features!"
fi
fi