From c2c2db3862879a364ed012a07b7977951e0e4a6f Mon Sep 17 00:00:00 2001 From: Watson Date: Wed, 5 Jun 2013 04:52:15 +0900 Subject: [PATCH] fix app.sim_args Because when passed the arguments as following app.sim_args += ["-com.apple.CoreData.SQLDebug 1"] application will receive the argument like argv[1] = ["-com.apple.CoreData.SQLDebug argv[2] = 1"] Expected: argv[1] = -com.apple.CoreData.SQLDebug argv[2] = 1 --- lib/motion/project/template/ios.rb | 4 ++-- lib/motion/project/template/osx.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/motion/project/template/ios.rb b/lib/motion/project/template/ios.rb index 20545828..28d31a0f 100644 --- a/lib/motion/project/template/ios.rb +++ b/lib/motion/project/template/ios.rb @@ -88,10 +88,10 @@ task :simulator => ['build:simulator'] do env << ' SIM_SPEC_MODE=1' if App.config.spec_mode sim = File.join(App.config.bindir, 'ios/sim') debug = (ENV['debug'] ? 1 : (App.config.spec_mode ? '0' : '2')) - app_args = App.config.sim_args.map { |x| '"' + x + '"' } + app_args = App.config.sim_args.map { |x| '"' + x + '"' }.join(" ") App.info 'Simulate', app at_exit { system("stty echo") } if $stdout.tty? # Just in case the simulator launcher crashes and leaves the terminal without echo. - sh "#{env} #{sim} #{debug} #{family_int} #{target} \"#{xcode}\" \"#{app}\" \"#{app_args}\"" + sh "#{env} #{sim} #{debug} #{family_int} #{target} \"#{xcode}\" \"#{app}\" #{app_args}" end desc "Create an .ipa archive" diff --git a/lib/motion/project/template/osx.rb b/lib/motion/project/template/osx.rb index 0bde2c25..67f8eeff 100644 --- a/lib/motion/project/template/osx.rb +++ b/lib/motion/project/template/osx.rb @@ -57,10 +57,10 @@ task :run => 'build:development' do sim = File.join(App.config.bindir, 'osx/sim') debug = (ENV['debug'] ? 1 : (App.config.spec_mode ? '0' : '2')) target = App.config.sdk_version - app_args = App.config.sim_args.map { |x| '"' + x + '"' } + app_args = App.config.sim_args.map { |x| '"' + x + '"' }.join(" ") App.info 'Run', exec at_exit { system("stty echo") } if $stdout.tty? # Just in case the process crashes and leaves the terminal without echo. - sh "#{env} #{sim} #{debug} #{target} \"#{exec}\" \"#{app_args}\"" + sh "#{env} #{sim} #{debug} #{target} \"#{exec}\" #{app_args}" end desc "Run the test/spec suite"