diff --git a/Mac/publish/publish.rb b/Mac/publish/publish.rb index dd0ca1d..57b7c27 100755 --- a/Mac/publish/publish.rb +++ b/Mac/publish/publish.rb @@ -1,26 +1,27 @@ #!/usr/bin/env ruby -wKU require 'time' -def test var message +def test var, message unless var puts message exit end end -mac_path = File.expand_path(File.dirname(File.expand_path(__FILE__)) + "/..") +path = File.dirname File.expand_path(__FILE__) +mac_path = File.expand_path(path + "/..") release_path = mac_path + "/build/Release/" version = `defaults read \"#{release_path}/Tentia.app/Contents/Info\" CFBundleVersion`.gsub(/\n/,'') length = `stat -f %z \"#{release_path}/Tentia.app.zip\"`.gsub(/\n/,'') -signature = `ruby \"#{mac_path}/../../../Sparkle\ 1.5b6/Extras/Signing Tools/sign_update.rb\" \"#{release_path}/Tentia.app.zip\" \"#{path}/public/dsa_priv.pem\"`.gsub(/\n/,'') +signature = `ruby \"#{mac_path}/../../Sparkle\ 1.5b6/Extras/Signing Tools/sign_update.rb\" \"#{release_path}/Tentia.app.zip\" \"#{mac_path}/publish/dsa_priv.pem\"`.gsub(/\n/,'') -test version "Couldn't find version" -test length "Couldn't find length" -test signature "Couldn't find signature" +test version, "Couldn't find version" +test length, "Couldn't find length" +test signature, "Couldn't find signature" -unless File.exists? "#{release_path}/Tentia.app/Contents/dsa_pub.pem" - puts "dsa_pub.pem is not in place." +unless File.exists? "#{release_path}/Tentia.app/Contents/Resources/dsa_pub.pem" + puts "#{release_path}/Tentia.app/Contents/dsa_pub.pem" exit end @@ -47,12 +48,8 @@ xml = < XML - -puts "EXIT" -exit - File.open("#{path}/Appcast.xml", 'w') {|f| f.write(xml) } -system "scp \"#{path}/../build/Release/Tentia.app.zip\" jeena@jeena.net:~/jabs.nu/public/Tentia/download/" +system "scp \"#{release_path}/Tentia.app.zip\" jeena@jeena.net:~/jabs.nu/public/Tentia/download/" system "scp \"#{path}/ReleaseNotes.html\" jeena@jeena.net:~/jabs.nu/public/Tentia/download/" system "scp \"#{path}/Appcast.xml\" jeena@jeena.net:~/jabs.nu/public/Tentia/download/"