fix a bug in the installer that prevented to create empty directories, 0.54

This commit is contained in:
Laurent Sansonetti
2012-03-06 14:58:45 +01:00
parent 9258c66112
commit 01570d1656
2 changed files with 12 additions and 4 deletions

5
NEWS
View File

@@ -1,3 +1,8 @@
= RubyMotion 0.54 =
* Fixed a bug in the installer where empty resources directories in some
samples would not be created.
= RubyMotion 0.53 =
* Added `motion support', which allows developers to submit support tickets.

View File

@@ -1,5 +1,5 @@
PLATFORMS_DIR = '/Applications/Xcode.app/Contents/Developer/Platforms'
PROJECT_VERSION = '0.53'
PROJECT_VERSION = '0.54'
sim_sdks = Dir.glob(File.join(PLATFORMS_DIR, 'iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator*.sdk')).map do |path|
File.basename(path).scan(/^iPhoneSimulator(.+)\.sdk$/)[0][0]
@@ -81,7 +81,6 @@ task :install do
#data.concat(Dir.glob('./doc/docset/**/*'))
data.concat(Dir.glob('./sample/**/*').reject { |path| path =~ /build/ })
data.reject! { |path| /^\./.match(File.basename(path)) }
data.reject! { |path| File.directory?(path) }
motiondir = '/Library/Motion'
destdir = (ENV['DESTDIR'] || '/')
@@ -90,8 +89,12 @@ task :install do
pathdir = File.join(destmotiondir, File.dirname(path))
mkdir_p pathdir unless File.exist?(pathdir)
destpath = File.join(destmotiondir, path)
cp path, destpath
chmod mode, destpath
if File.directory?(path)
mkdir_p destpath
else
cp path, destpath
chmod mode, destpath
end
destpath
end