Created
April 29, 2019 20:18
-
-
Save mmdock/eac9012de275418b3e6a213774dd4ca6 to your computer and use it in GitHub Desktop.
simple script to setup a new environment for Xcode (with maybe an existing repo)
This file contains hidden or 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
xcode-select --install | |
which -s brew | |
if [[ $? != 0 ]]; then | |
# Install Homebrew | |
sudo ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
echo "installed Homebrew" | |
else | |
sudo brew update | |
echo "Homebrew installed" | |
fi | |
which -s bundle | |
if [[ $? != 0 ]]; then | |
# Install Bundler | |
sudo brew install bundler | |
echo "installed Bundler" | |
else | |
# update | |
echo "Bundler installed" | |
fi | |
test -f Gemfile | |
if [[ $? != 0 ]]; then | |
# Install Gemfile | |
bundle install | |
echo "installed Gemfile" | |
else | |
echo "no Gemfile to install" | |
fi | |
which -s pod | |
if [[ $? != 0 ]]; then | |
# Install Cocoapods | |
sudo gem install cocoapods | |
pod repo update | |
echo "installed cocoapods" | |
else | |
# If pod was included in | |
pod repo update | |
echo "Cocoapods installed" | |
fi | |
test -f Podfile | |
if [[ $? != 0 ]]; then | |
# Install Bundler | |
pod install | |
echo "installed cocoapods's pods" | |
else | |
# If Pofile wasn't included | |
echo "Podfile not found" | |
fi | |
which -s carthage | |
if [[ $? != 0 ]]; then | |
sudo brew install carthage | |
else | |
echo "Carthage installed" | |
fi | |
test -f Cartfile | |
if [[ $? != 0 ]]; then | |
carthage upate | |
echo "Cartfile frameworks setup" | |
echo "Reminder: follow Carthage guides for setting up frameworks.\nSee: https://github.com/Carthage/Carthage#adding-frameworks-to-an-application for details." | |
else | |
echo "Cartfile not found" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment