Method: GitCli::Repos#remote_config

Defined in:
lib/git_cli/repos.rb

#remote_configObject



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/git_cli/repos.rb', line 22

def remote_config
  check_vcs

  cmd = []
  cmd << "cd"
  cmd << @wsPath
  cmd << "&&"
  cmd << @vcs.exe_path
  cmd << "remote -vv"

  cmdln = cmd.join(" ")
  log_debug "Remote config : #{cmdln}"
  res = os_exec(cmdln) do |st, res|
    
    if st.success?

      remotes = { }
      res.each_line do |l|
        ls = l.split("\t")
        lss = ls[1].split(" ")
        if not remotes.keys.include?(ls[0])
          remotes[ls[0]] = lss[0]
        end
      end

      [true, remotes]
    else
      [false, res]
    end
  end
  
end