#! /usr/bin/env ruby

require "spaceship"
# Until they fix deliver to remove old, need to do this
# https://github.com/fastlane/fastlane/issues/1529#issuecomment-193381124
#Spaceship.login( "appdev@sharefaith.com", "c~3+#v[fB}:X" )
Spaceship::Tunes.login( "appdev@sharefaith.com", "QaarxOsuB5N7v447D4KT" )
du = Spaceship::Tunes.client.du_client

bundle_id = ARGV[0]

app = Spaceship::Tunes::Application.find bundle_id

if app.edit_version #:
    v = app.edit_version
    puts( '<string>' + v.version + '</string>')
elsif app.live_version #:
	v = app.live_version
	puts( '<string>' + v.version + '</string>')
end
