Skip to content

Instantly share code, notes, and snippets.

@brettohland
Forked from timuruski/nuke-pods.rb
Created May 8, 2015 13:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brettohland/6d61fbe55278375fc959 to your computer and use it in GitHub Desktop.
Save brettohland/6d61fbe55278375fc959 to your computer and use it in GitHub Desktop.
#! /usr/bin/env ruby
require 'fileutils'
require 'pathname'
#Remove the \n character at the end of the path returned
root = %x(git rev-parse --show-toplevel).chomp
root_path = Pathname.new(root)
podfile = root + '/Podfile.lock'
pods = root + '/Pods'
podfile_path = Pathname.new(podfile)
pods_path = Pathname.new(pods)
podfile_path.delete() if podfile_path.exist?
pods_path.rmtree if pods_path.exist?
system 'pod install' unless podfile_path.exist? and pods_path.exist?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment