lib/sigh/manager.rb in sigh-0.4.10 vs lib/sigh/manager.rb in sigh-0.5.0

- old
+ new

@@ -1,5 +1,7 @@ +require 'plist' + module Sigh class Manager def self.start path = Sigh::DeveloperCenter.new.run @@ -25,16 +27,21 @@ Helper.log.info "Installing provisioning profile..." profile_path = File.expand_path("~") + "/Library/MobileDevice/Provisioning Profiles/" profile_filename = ENV["SIGH_UDID"] + ".mobileprovision" destination = profile_path + profile_filename + # If the directory doesn't exist, make it first + unless File.directory?(profile_path) + FileUtils.mkdir_p(profile_path) + end + # copy to Xcode provisioning profile directory - FileUtils.copy profile, destination + (FileUtils.copy profile, destination rescue nil) # if the directory doesn't exist yet if File.exists? destination Helper.log.info "Profile installed at \"#{destination}\"" else raise "Failed installation of provisioning profile at location: #{destination}".red end end end -end \ No newline at end of file +end