mirror of
https://github.com/pgsty/minio.git
synced 2026-07-21 21:20:23 +03:00
configMigrate() returns errors + tests (#2735)
This commit is contained in:
committed by
Harshavardhana
parent
018c90dae7
commit
e66fb4bd7b
+9
-2
@@ -17,6 +17,7 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"sort"
|
||||
@@ -79,7 +80,8 @@ func init() {
|
||||
|
||||
func migrate() {
|
||||
// Migrate config file
|
||||
migrateConfig()
|
||||
err := migrateConfig()
|
||||
fatalIf(err, "Config migration failed.")
|
||||
|
||||
// Migrate other configs here.
|
||||
}
|
||||
@@ -157,8 +159,13 @@ func checkMainSyntax(c *cli.Context) {
|
||||
func Main() {
|
||||
app := registerApp()
|
||||
app.Before = func(c *cli.Context) error {
|
||||
|
||||
configDir := c.GlobalString("config-dir")
|
||||
if configDir == "" {
|
||||
fatalIf(errors.New("Config directory is empty"), "Unable to get config file.")
|
||||
}
|
||||
// Sets new config folder.
|
||||
setGlobalConfigPath(c.GlobalString("config-dir"))
|
||||
setGlobalConfigPath(configDir)
|
||||
|
||||
// Valid input arguments to main.
|
||||
checkMainSyntax(c)
|
||||
|
||||
Reference in New Issue
Block a user