forked from git-lfs/git-lfs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommand_env.go
More file actions
50 lines (41 loc) · 1.25 KB
/
command_env.go
File metadata and controls
50 lines (41 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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
package commands
import (
"github.com/github/git-lfs/config"
"github.com/github/git-lfs/git"
"github.com/github/git-lfs/lfs"
"github.com/spf13/cobra"
)
func envCommand(cmd *cobra.Command, args []string) {
config.ShowConfigWarnings = true
endpoint := cfg.Endpoint("download")
gitV, err := git.Config.Version()
if err != nil {
gitV = "Error getting git version: " + err.Error()
}
Print(config.VersionDesc)
Print(gitV)
Print("")
if len(endpoint.Url) > 0 {
Print("Endpoint=%s (auth=%s)", endpoint.Url, cfg.EndpointAccess(endpoint))
if len(endpoint.SshUserAndHost) > 0 {
Print(" SSH=%s:%s", endpoint.SshUserAndHost, endpoint.SshPath)
}
}
for _, remote := range cfg.Remotes() {
remoteEndpoint := cfg.RemoteEndpoint(remote, "download")
Print("Endpoint (%s)=%s (auth=%s)", remote, remoteEndpoint.Url, cfg.EndpointAccess(remoteEndpoint))
if len(remoteEndpoint.SshUserAndHost) > 0 {
Print(" SSH=%s:%s", remoteEndpoint.SshUserAndHost, remoteEndpoint.SshPath)
}
}
for _, env := range lfs.Environ(cfg, TransferManifest()) {
Print(env)
}
for _, key := range []string{"filter.lfs.smudge", "filter.lfs.clean"} {
value, _ := cfg.Git.Get(key)
Print("git config %s = %q", key, value)
}
}
func init() {
RegisterCommand("env", envCommand, nil)
}