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
  • Save brettohland/6d61fbe55278375fc959 to your computer and use it in GitHub Desktop.
Save brettohland/6d61fbe55278375fc959 to your computer and use it in GitHub Desktop.

Revisions

  1. brettohland revised this gist May 8, 2015. 1 changed file with 13 additions and 9 deletions.
    22 changes: 13 additions & 9 deletions nuke-pods.rb
    Original file line number Diff line number Diff line change
    @@ -1,15 +1,19 @@
    #! /usr/bin/env ruby

    # Not guaranteed to work.


    require 'fileutils'
    require 'pathname'

    root = Pathname.new %x(git rev-parse --show-toplevel)
    podfile_path = root + 'Podfile.lock'
    pods_path = root + 'Pods'
    #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_path.rm if podfile_path.exist?
    pods_path.rmdir rescue nil
    podfile = root + '/Podfile.lock'
    pods = root + '/Pods'

    system 'pod install'
    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?
  2. @timuruski timuruski created this gist May 7, 2015.
    15 changes: 15 additions & 0 deletions nuke-pods.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    #! /usr/bin/env ruby

    # Not guaranteed to work.

    require 'fileutils'
    require 'pathname'

    root = Pathname.new %x(git rev-parse --show-toplevel)
    podfile_path = root + 'Podfile.lock'
    pods_path = root + 'Pods'

    podfile_path.rm if podfile_path.exist?
    pods_path.rmdir rescue nil

    system 'pod install'