class Bump::CLI::Commands::Preview

Public Instance Methods

call(file:, **options) click to toggle source
# File lib/bump/cli/commands/preview.rb, line 12
def call(file:, **options)
  with_errors_rescued do
    response = post(
      url: API_URL + "/previews",
      body: body(file, **options).to_json
    )

    if response.code == 201
      body = JSON.parse(response.body)
      puts "Preview created : #{ROOT_URL + "/preview/" + body["id"]} (expires at #{body["expires_at"]})"
    else
      display_error(response)
    end
  end
end