(cmd *cobra.Command, args []string)
| 9 | ) |
| 10 | |
| 11 | func envCommand(cmd *cobra.Command, args []string) { |
| 12 | config.ShowConfigWarnings = true |
| 13 | |
| 14 | gitV, err := git.Version() |
| 15 | if err != nil { |
| 16 | gitV = tr.Tr.Get("Error getting Git version: %s", err.Error()) |
| 17 | } |
| 18 | |
| 19 | Print(config.VersionDesc) |
| 20 | Print(gitV) |
| 21 | Print("") |
| 22 | |
| 23 | defaultRemote := "" |
| 24 | if cfg.IsDefaultRemote() { |
| 25 | defaultRemote = cfg.Remote() |
| 26 | endpoint := getAPIClient().Endpoints.Endpoint("download", defaultRemote) |
| 27 | if len(endpoint.Url) > 0 { |
| 28 | access := getAPIClient().Endpoints.AccessFor(endpoint.Url) |
| 29 | Print("Endpoint=%s (auth=%s)", endpoint.Url, access.Mode()) |
| 30 | if len(endpoint.SSHMetadata.UserAndHost) > 0 { |
| 31 | Print(" SSH=%s:%s", endpoint.SSHMetadata.UserAndHost, endpoint.SSHMetadata.Path) |
| 32 | } |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | for _, remote := range cfg.Remotes() { |
| 37 | if remote == defaultRemote { |
| 38 | continue |
| 39 | } |
| 40 | remoteEndpoint := getAPIClient().Endpoints.Endpoint("download", remote) |
| 41 | remoteAccess := getAPIClient().Endpoints.AccessFor(remoteEndpoint.Url) |
| 42 | Print("Endpoint (%s)=%s (auth=%s)", remote, remoteEndpoint.Url, remoteAccess.Mode()) |
| 43 | if len(remoteEndpoint.SSHMetadata.UserAndHost) > 0 { |
| 44 | Print(" SSH=%s:%s", remoteEndpoint.SSHMetadata.UserAndHost, remoteEndpoint.SSHMetadata.Path) |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | for _, env := range lfs.Environ(cfg, getTransferManifest(), oldEnv) { |
| 49 | Print(env) |
| 50 | } |
| 51 | |
| 52 | for _, key := range []string{"filter.lfs.process", "filter.lfs.smudge", "filter.lfs.clean"} { |
| 53 | value, _ := cfg.Git.Get(key) |
| 54 | Print("git config %s = %q", key, value) |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | func init() { |
| 59 | RegisterCommand("env", envCommand, nil) |
nothing calls this directly
no test coverage detected