diff --git a/Rakefile b/Rakefile index ace7edb..30e8c59 100644 --- a/Rakefile +++ b/Rakefile @@ -89,8 +89,7 @@ namespace :build do desc "Build a disk image for the iOS static framework" task :diskimage => :framework do - FileUtils.mkdir_p("pkg") - system("hdiutil create -srcfolder #{BUILD_DIR}/Release pkg/LRResty-iOS-#{PACKAGE_SUFFIX}.dmg") + create_disk_image("pkg", "#{BUILD_DIR}/Release", "LRResty-iOS-#{PACKAGE_SUFFIX}.dmg") end end @@ -100,8 +99,7 @@ namespace :build do desc "Build a disk image for the Mac framework" task :diskimage => :framework do - FileUtils.mkdir_p("pkg") - system("hdiutil create -srcfolder #{BUILD_DIR}/Release pkg/LRResty-Mac-#{PACKAGE_SUFFIX}.dmg") + create_disk_image("pkg", "#{BUILD_DIR}/Release", "LRResty-Mac-#{PACKAGE_SUFFIX}.dmg") end end @@ -142,6 +140,11 @@ namespace :build do end end + def create_disk_image(destination, source, output_file) + FileUtils.mkdir_p(destination) + system("hdiutil create -srcfolder #{source} #{destination}/#{output_file} -ov") + end + def prompt_for_password fetch_password_from_keychain(GITHUB_USER) || ask("Enter Github password (#{GITHUB_USER}):", String) {|q| q.echo = false }.tap do |password| store_password_in_keychain(GITHUB_USER, password)