Class: PodBuilder::Command::SyncPodfile

Inherits:
Object
  • Object
show all
Defined in:
lib/pod_builder/command/sync_podfile.rb

Class Method Summary collapse

Class Method Details

.call(options) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/pod_builder/command/sync_podfile.rb', line 6

def self.call(options)
  Configuration.check_inited
  PodBuilder::prepare_basepath
  
  install_update_repo = options.fetch(:update_repos, true)
  installer, analyzer = Analyze.installer_at(PodBuilder::basepath, install_update_repo)

  all_buildable_items = Analyze.podfile_items(installer, analyzer)

  Dir.chdir(PodBuilder::project_path)

  previous_podfile_content = File.read("Podfile")
  Podfile::write_prebuilt(all_buildable_items, analyzer)        
  updated_podfile_content = File.read("Podfile")

  Licenses::write([], all_buildable_items)

  if previous_podfile_content != updated_podfile_content
    system("pod install")
  end
  
  return 0
end