bin/calabash-ios-setup.rb in calabash-cucumber-0.9.35 vs bin/calabash-ios-setup.rb in calabash-cucumber-0.9.36
- old
+ new
@@ -216,25 +216,20 @@
pbx.parse
pwd = FileUtils.pwd
FileUtils.cd project_path
##Backup
- msg("Info") do
- puts "Making backup of project file: #{proj_file}"
- if File.exists? "#{proj_file}.bak"
- msg("Error") do
- puts "Backup file already exists. #{proj_file}.bak"
- puts "For safety, I won't overwrite this file."
- puts "You must manually move this file, if you want to"
- puts "Run calabash-ios setup again."
- end
- exit 1
+ if File.exists? "#{proj_file}.bak"
+ msg("Error") do
+ puts "Backup file already exists. #{proj_file}.bak"
+ puts "For safety, I won't overwrite this file."
+ puts "You must manually move this file, if you want to"
+ puts "Run calabash-ios setup again."
end
- FileUtils.cp(proj_file, "#{proj_file}.bak")
- puts "Saved as #{proj_file}.bak"
-
+ exit 1
end
+
file = download_calabash(project_path)
file_ref = pbx.sections['PBXFileReference'].find do |fr|
/calabash\.framework/.match(fr.path)
@@ -409,9 +404,18 @@
sp << PBXProject::PBXTypes::BasicValue.new(:value => '"$(inherited)"') unless inherit
sp << PBXProject::PBXTypes::BasicValue.new(:value => "\"$(SRCROOT)\"") unless srcroot
bc.buildSettings["FRAMEWORK_SEARCH_PATHS"] = sp
end
FileUtils.cd pwd
+
+ ##Backup
+ msg("Info") do
+ puts "Making backup of project file: #{proj_file}"
+ FileUtils.cp(proj_file, "#{proj_file}.bak")
+ puts "Saved as #{proj_file}.bak"
+ end
+
+
pbx.write_to :file => proj_file
return target
end
\ No newline at end of file