Skip to content

Commit

Permalink
Ensure diskimages are overwritten when building
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeredpath committed Jul 2, 2011
1 parent 192400e commit ab3bf16
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Rakefile
Expand Up @@ -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

Expand All @@ -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

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit ab3bf16

Please sign in to comment.