when running the simulator, clean the sandbox directory only if the clean environment variable is set to any value

This commit is contained in:
Laurent Sansonetti
2011-12-21 13:50:54 +01:00
parent ac600b74bf
commit 1509d165a4

View File

@@ -30,12 +30,14 @@ task :simulator => ['build:simulator'] do
sdk_version = App.config.sdk_version sdk_version = App.config.sdk_version
# Cleanup the simulator application sandbox, to avoid having old resource files there. # Cleanup the simulator application sandbox, to avoid having old resource files there.
sim_apps = File.expand_path("~/Library/Application Support/iPhone Simulator/#{sdk_version}/Applications") if ENV['clean']
Dir.glob("#{sim_apps}/**/*.app").each do |app_bundle| sim_apps = File.expand_path("~/Library/Application Support/iPhone Simulator/#{sdk_version}/Applications")
if File.basename(app_bundle) == File.basename(app) Dir.glob("#{sim_apps}/**/*.app").each do |app_bundle|
rm_rf File.dirname(app_bundle) if File.basename(app_bundle) == File.basename(app)
break rm_rf File.dirname(app_bundle)
end break
end
end
end end
# Launch the simulator. # Launch the simulator.