commands: initialize locale on startup
As the first thing we do when we run a command, let's initialize the locale. This will let us print any sort of error or warning messages in the user's preferred language if we have any problems.
This commit is contained in:
parent
182ed28852
commit
7e51166aa0
@ -11,6 +11,7 @@ import (
|
||||
|
||||
"github.com/git-lfs/git-lfs/v3/config"
|
||||
"github.com/git-lfs/git-lfs/v3/tools"
|
||||
"github.com/git-lfs/git-lfs/v3/tr"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
@ -56,6 +57,7 @@ func RegisterCommand(name string, runFn func(cmd *cobra.Command, args []string),
|
||||
// It returns an exit code.
|
||||
func Run() int {
|
||||
log.SetOutput(ErrorWriter)
|
||||
tr.InitializeLocale()
|
||||
|
||||
root := NewCommand("git-lfs", gitlfsCommand)
|
||||
root.PreRun = nil
|
||||
|
Loading…
Reference in New Issue
Block a user