Sha256: 705b2f58fb96dcc3bafd464e7ef1dfe9ed611d00840278d958d9fbc18981dbf9

Contents?: true

Size: 1.03 KB

Versions: 73

Compression:

Stored size: 1.03 KB

Contents

# frozen_string_literal: true

require_relative "../../base"

module Neetob
  class CLI
    module Heroku
      module Access
        class Add < Base
          attr_accessor :apps, :new_users, :sandbox

          def initialize(apps, new_users = [], sandbox = false)
            super()
            @apps = apps
            @new_users = new_users
            @sandbox = sandbox
          end

          def run
            matching_apps = find_all_matching_apps_or_repos(apps, :heroku, sandbox)
            matching_apps.each do |app|
              `heroku access -a #{app}`
              unless $?.success?
                ui.error("There is a problem in accessing the app with name \"#{app}\" in your account.")
                ui.error("Please check the specified app name and ensure you're authorized to view that app.")
                next
              end

              new_users.each do |user|
                ui.info(`heroku access:add #{user} -a #{app}`)
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

73 entries across 73 versions & 1 rubygems

Version Path
neetob-0.4.27 lib/neetob/cli/heroku/access/add.rb
neetob-0.4.26 lib/neetob/cli/heroku/access/add.rb
neetob-0.4.24 lib/neetob/cli/heroku/access/add.rb
neetob-0.4.23 lib/neetob/cli/heroku/access/add.rb
neetob-0.4.22 lib/neetob/cli/heroku/access/add.rb
neetob-0.4.21 lib/neetob/cli/heroku/access/add.rb
neetob-0.4.20 lib/neetob/cli/heroku/access/add.rb
neetob-0.4.19 lib/neetob/cli/heroku/access/add.rb
neetob-0.4.16 lib/neetob/cli/heroku/access/add.rb
neetob-0.4.15 lib/neetob/cli/heroku/access/add.rb
neetob-0.4.14 lib/neetob/cli/heroku/access/add.rb
neetob-0.4.13 lib/neetob/cli/heroku/access/add.rb
neetob-0.4.12 lib/neetob/cli/heroku/access/add.rb
neetob-0.4.11 lib/neetob/cli/heroku/access/add.rb
neetob-0.4.10 lib/neetob/cli/heroku/access/add.rb
neetob-0.4.9 lib/neetob/cli/heroku/access/add.rb
neetob-0.4.8 lib/neetob/cli/heroku/access/add.rb
neetob-0.4.7 lib/neetob/cli/heroku/access/add.rb
neetob-0.4.6 lib/neetob/cli/heroku/access/add.rb
neetob-0.4.5 lib/neetob/cli/heroku/access/add.rb