From 32508cf243446b92e763c5d50d51eb4cb1ef8330 Mon Sep 17 00:00:00 2001 From: Watson Date: Sun, 23 Mar 2014 00:38:40 +0900 Subject: [PATCH] fix build error if resource directory does not exits This bug is introduced by 064672443dc1ff3d8920023f51e46d73f90bbec1 % motion create hello && cd hello % rm -rf resources % rake rake aborted! No such file or directory @ dir_initialize - ./resources /Library/RubyMotion/lib/motion/project/template/ios.rb:51:in `open' /Library/RubyMotion/lib/motion/project/template/ios.rb:51:in `entries' /Library/RubyMotion/lib/motion/project/template/ios.rb:51:in `block in pre_build_actions' /Library/RubyMotion/lib/motion/project/template/ios.rb:50:in `each' /Library/RubyMotion/lib/motion/project/template/ios.rb:50:in `pre_build_actions' /Library/RubyMotion/lib/motion/project/template/ios.rb:66:in `block (2 levels) in ' /Library/RubyMotion/lib/motion/project/template/ios.rb:121:in `block in ' Tasks: TOP => build:simulator (See full trace by running task with --trace) --- lib/motion/project/template/ios.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/motion/project/template/ios.rb b/lib/motion/project/template/ios.rb index d6d785c8..7cd2b323 100644 --- a/lib/motion/project/template/ios.rb +++ b/lib/motion/project/template/ios.rb @@ -48,6 +48,7 @@ namespace :build do # TODO this should go into a iOS specific Builder class which performs this # check before building. App.config.resources_dirs.each do |dir| + next unless Dir.exists?(dir) Dir.entries(dir).grep(/Resources/i).each do |basename| path = File.join(dir, basename) if File.directory?(path)