mirror of
https://github.com/minio/minio.git
synced 2026-02-04 18:00:15 -05:00
Honor global flags irrespective of the position. (#5486)
Flags like `json, config-dir, quiet` are now honored even if they are between minio and gateway in the cli, like, `minio --json gateway s3`. Fixes #5403
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Minio Cloud Storage, (C) 2015, 2016, 2017 Minio, Inc.
|
||||
* Minio Cloud Storage, (C) 2015, 2016, 2017, 2018 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -95,14 +95,16 @@ func (config *ConfigDir) GetPrivateKeyFile() string {
|
||||
return filepath.Join(config.getCertsDir(), privateKeyFile)
|
||||
}
|
||||
|
||||
func mustGetDefaultConfigDir() string {
|
||||
func getDefaultConfigDir() string {
|
||||
homeDir, err := homedir.Dir()
|
||||
fatalIf(err, "Unable to get home directory.")
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
|
||||
return filepath.Join(homeDir, defaultMinioConfigDir)
|
||||
}
|
||||
|
||||
var configDir = &ConfigDir{dir: mustGetDefaultConfigDir()}
|
||||
var configDir = &ConfigDir{dir: getDefaultConfigDir()}
|
||||
|
||||
func setConfigDir(dir string) {
|
||||
configDir.Set(dir)
|
||||
|
||||
Reference in New Issue
Block a user