Module: SfCli::Sf::Org::List
- Included in:
- Core
- Defined in:
- lib/sf_cli/sf/org/list.rb
Defined Under Namespace
Classes: OrgConfig
Instance Method Summary collapse
-
#list ⇒ Array
List orgs you’ve created or authenticated to.
Instance Method Details
#list ⇒ Array
Note:
this function returns org information including security sensitive things such as access token, username and so on.
List orgs you’ve created or authenticated to
51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/sf_cli/sf/org/list.rb', line 51 def list flags = { # reserved for later option addition } json = exec(__method__, flags: flags, redirection: :null_stderr) others = json['result']['other'].map{|config| OrgConfig.new(**config)} sandboxes = json['result']['sandboxes'].map{|config| OrgConfig.new(**config)} non_scratch_orgs = json['result']['nonScratchOrgs'].map{|config| OrgConfig.new(**config)} devhubs = json['result']['devHubs'].map{|config| OrgConfig.new(**config)} scratch_orgs = json['result']['scratchOrgs'].map{|config| OrgConfig.new(**config)} (others + sandboxes + non_scratch_orgs + devhubs + scratch_orgs).uniq{|config| config.alias} end |