I have a run script build phase I have added to an Xcode project.
I want to be able to toggle this run script on when I want it to run and off when I don't.
Is this possible in Xcode and if so how can it be done?
I used to write exit
in the first line to toggle off the script and #exit
to toggle on, just like this:
Turn off a script e.g. SwiftLint:
exit
if which swiftlint >/dev/null; then
swiftlint
else
echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"
fi
Turn on:
#exit
if which swiftlint >/dev/null; then
swiftlint
else
echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"
fi
You just have to modify 1 character whether exit is commented out or not.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With