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



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

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
18
# File 'lib/fastlane/plugin/codepush/helper/codepush_login_helper.rb', line 8

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

.logoutObject



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

def self.logout
  Action.sh("appcenter logout")
  UI.message("✅Logged out successfully")
end