mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-23 12:27:56 +08:00
don't attempt copying resources if resources_dir doesn't exist
This commit is contained in:
@@ -173,15 +173,17 @@ EOS
|
||||
File.open(File.join(bundle_path, 'PkgInfo'), 'w') { |io| io.write(config.pkginfo_data) }
|
||||
|
||||
# Copy resources, re-create subdirectories.
|
||||
resources_files = Dir.chdir(config.resources_dir) do
|
||||
Dir.glob('**/*').reject { |x| File.directory?(x) }
|
||||
end
|
||||
resources_files.each do |res|
|
||||
res_path = File.join(config.resources_dir, res)
|
||||
dest_path = File.join(bundle_path, res)
|
||||
if !File.exist?(dest_path) or File.mtime(res_path) > File.mtime(dest_path)
|
||||
FileUtils.mkdir_p(File.dirname(dest_path))
|
||||
FileUtils.cp(res_path, File.dirname(dest_path))
|
||||
if File.exist?(config.resources_dir)
|
||||
resources_files = Dir.chdir(config.resources_dir) do
|
||||
Dir.glob('**/*').reject { |x| File.directory?(x) }
|
||||
end
|
||||
resources_files.each do |res|
|
||||
res_path = File.join(config.resources_dir, res)
|
||||
dest_path = File.join(bundle_path, res)
|
||||
if !File.exist?(dest_path) or File.mtime(res_path) > File.mtime(dest_path)
|
||||
FileUtils.mkdir_p(File.dirname(dest_path))
|
||||
FileUtils.cp(res_path, File.dirname(dest_path))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user