lib/heroku/command/pgbackups.rb
# pgbackups:url [BACKUP_ID]
#
# get a temporary URL for a backup
#
url [BACKUP_ID]
get a temporary URL for a backup
url [ BACKUP_ID ] get a temporary URL for a backup
def url
      name = shift_argument
      validate_arguments!
      if name
        b = pgbackup_client.get_backup(name)
      else
        b = pgbackup_client.get_latest_backup
      end
      unless b['public_url']
        error("No backup found.")
      end
      if $stdout.isatty
        display '"'+b['public_url']+'"'
      else
        display b['public_url']
      end
    end
def url name = shift_argument validate_arguments! if name b = pgbackup_client . get_backup ( name ) else b = pgbackup_client . get_latest_backup end unless b [ 'public_url' ] error ( "No backup found." ) end if $stdout . isatty display '"' + b [ 'public_url' ] + '"' else display b [ 'public_url' ] end end
pgbackups:url [BACKUP_ID]
get a temporary URL for a backup
pgbackups : url [ BACKUP_ID ] get a temporary URL for a backup