Recently the git policy changes at work, and from that point, Pods directory was globally ignored. Because of that, every time we checkout a project, we have to do pod install in the terminal. Too time comsuming.
Thanks to Tower Support guys, I knew about Git Hooks, that is a way to fire off custom scripts when certain important actions occur. From this point all become simple. I created a post-checkout script to install required cocoa pods after every checkout. To do it, you have to create a file on you project .git/hooks directory, name it post-checkout and have execution permissions.
This is the script for doing it:
#!/bin/bashif[ -f Podfile ]&&command -v pod install >/dev/null
then(unset GIT_DIR;exec pod install)truefi
Replace your-username, your-password and your-iphone-mac.
your-username must be an administrator user that can sudo on your computer.
your-password password for that user.
your-iphone-mac can be obtained on your iphone, go to Settings -> General -> About and copy Wi-Fi Address.
The script execute as administrator the command arp-scan. This command sends ARP packets to hosts on the local network and displays any responses that are received. The grep command look for your iphone on the answer receive by arp-scan. If the iphone is found, then return 1, otherwise, return 0. On 1, the script do click on Available menu item in Messages, on 0, the same on Away (can be changed by Offline, On the phone, etc).
So, let’s do it automatically.
Go to folder /Users/your-username/Library/LaunchAgents and save there the following plist file. I named it com.username.checkiphone.plist, but again, feel free to change it.
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plistversion="1.0"><dict><key>Label</key><string>com.your-username.checkiphone</string><key>ProgramArguments</key><array><string>/usr/bin/osascript</string><string>/Users/your-username/bin/check-iphone-available.scpt</string></array><key>Nice</key><integer>1</integer><key>StartInterval</key><integer>60</integer><key>RunAtLoad</key><true/><key>StandardErrorPath</key><string>/tmp/com.your-username.checkiphone-available.err</string><key>StandardOutPath</key><string>/tmp/com.your-username.checkiphone-available.out</string></dict></plist>
The file is pretty self-explanatory. We will launch the command /usr/bin/osascript /Users/your-username/bin/check-iphone-available.scpt every 60 seconds, will be launched at load, will save errors on /tmp/com.username.checkiphone-available.err and logs on /tmp/com.username.checkiphone-available.out.
Again, replace your-username appropriately.
Last step, tell the Mac launchd daemon to load it.
I purchased the certificate on https://ssls.com, it’s the cheaper site I found. You can get one from $8.95 if you pay for a year to $4.99/year if you pay for five years. In the buying process you must paste your previously generated <your-domain>.crs. I don’t want to enter in the certificate purchase, so, move on. When the certificate is ready, you will receive an email with a file containing the following:
When you see file:// is because you are in the same directory as your certificate files. If not the case, use file:///path/to/your/files. Path parameter must end with /, otherwise you will get an error.
Final step, edit your Cloudfront distribution, and select your certificate under Custom SSL Certificate (stored in AWS IAM).