2014-06-03 15:08:58 +00:00
|
|
|
package commands
|
2013-11-05 17:52:31 +00:00
|
|
|
|
|
|
|
import (
|
2016-11-15 17:01:18 +00:00
|
|
|
"github.com/git-lfs/git-lfs/config"
|
|
|
|
"github.com/git-lfs/git-lfs/git"
|
|
|
|
"github.com/git-lfs/git-lfs/lfs"
|
2016-05-23 18:02:27 +00:00
|
|
|
"github.com/spf13/cobra"
|
2013-11-05 17:52:31 +00:00
|
|
|
)
|
|
|
|
|
2014-06-26 20:09:14 +00:00
|
|
|
func envCommand(cmd *cobra.Command, args []string) {
|
2016-05-13 16:43:04 +00:00
|
|
|
config.ShowConfigWarnings = true
|
2016-07-21 22:37:53 +00:00
|
|
|
endpoint := cfg.Endpoint("download")
|
2015-03-27 22:36:33 +00:00
|
|
|
|
2015-06-17 17:08:22 +00:00
|
|
|
gitV, err := git.Config.Version()
|
|
|
|
if err != nil {
|
|
|
|
gitV = "Error getting git version: " + err.Error()
|
|
|
|
}
|
|
|
|
|
2016-05-16 11:13:13 +00:00
|
|
|
Print(config.VersionDesc)
|
2015-06-17 17:08:22 +00:00
|
|
|
Print(gitV)
|
|
|
|
Print("")
|
|
|
|
|
2015-03-27 22:36:33 +00:00
|
|
|
if len(endpoint.Url) > 0 {
|
2016-07-21 22:37:53 +00:00
|
|
|
Print("Endpoint=%s (auth=%s)", endpoint.Url, cfg.EndpointAccess(endpoint))
|
2015-03-27 22:36:33 +00:00
|
|
|
if len(endpoint.SshUserAndHost) > 0 {
|
|
|
|
Print(" SSH=%s:%s", endpoint.SshUserAndHost, endpoint.SshPath)
|
|
|
|
}
|
2014-02-01 20:46:58 +00:00
|
|
|
}
|
|
|
|
|
2016-07-21 22:37:53 +00:00
|
|
|
for _, remote := range cfg.Remotes() {
|
|
|
|
remoteEndpoint := cfg.RemoteEndpoint(remote, "download")
|
|
|
|
Print("Endpoint (%s)=%s (auth=%s)", remote, remoteEndpoint.Url, cfg.EndpointAccess(remoteEndpoint))
|
2015-11-11 12:46:56 +00:00
|
|
|
if len(remoteEndpoint.SshUserAndHost) > 0 {
|
|
|
|
Print(" SSH=%s:%s", remoteEndpoint.SshUserAndHost, remoteEndpoint.SshPath)
|
2015-03-27 22:36:33 +00:00
|
|
|
}
|
2014-02-01 20:38:29 +00:00
|
|
|
}
|
|
|
|
|
2016-08-10 16:08:08 +00:00
|
|
|
for _, env := range lfs.Environ(cfg, TransferManifest()) {
|
2014-06-05 18:19:30 +00:00
|
|
|
Print(env)
|
2014-01-24 01:30:48 +00:00
|
|
|
}
|
2015-09-23 20:02:22 +00:00
|
|
|
|
2016-10-24 06:13:49 +00:00
|
|
|
for _, key := range []string{"filter.lfs.process", "filter.lfs.smudge", "filter.lfs.clean"} {
|
2016-08-15 21:43:38 +00:00
|
|
|
value, _ := cfg.Git.Get(key)
|
2015-09-23 20:02:22 +00:00
|
|
|
Print("git config %s = %q", key, value)
|
|
|
|
}
|
2013-11-05 17:52:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
2016-08-31 22:51:37 +00:00
|
|
|
RegisterCommand("env", envCommand, nil)
|
2013-11-05 17:52:31 +00:00
|
|
|
}
|