Class: Fastlane::Helper::CodepushLoginHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/fastlane/plugin/codepush/helper/codepush_login_helper.rb

Class Method Summary collapse

Class Method Details

.is_logged_inObject



23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/fastlane/plugin/codepush/helper/codepush_login_helper.rb', line 23

def self.is_logged_in
  logged_in = true
  begin
    Action.sh(
      "appcenter profile list",
      print_command: false
    )
    UI.message("User is already logged in")
  rescue
    logged_in = false
    UI.message("User is not logged in")
  end
  logged_in
end

.login(login_token) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/fastlane/plugin/codepush/helper/codepush_login_helper.rb', line 8

def self.()
  Action.sh(
    "appcenter login --token #{}",
    print_command: false
  )
rescue StandardError
  UI.user_error!(
    "Something went wrong during App Center login!! Please ensure login token #{} is correct"
  )
end

.logoutObject



19
20
21
# File 'lib/fastlane/plugin/codepush/helper/codepush_login_helper.rb', line 19

def self.logout
  Action.sh("appcenter logout")
end