@ -17,7 +17,6 @@
package cmd
import (
"errors"
"fmt"
"os"
"sort"
@ -148,19 +147,26 @@ func checkMainSyntax(c *cli.Context) {
}
}
// Main main for minio server.
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." )
// Check for updates and print a notification message
func checkUpdate ( ) {
// Do not print update messages, if quiet flag is set.
if ! globalQuiet {
updateMsg , _ , err := getReleaseUpdate ( minioUpdateStableURL , 1 * time . Second )
if err != nil {
// Ignore any errors during getReleaseUpdate(), possibly
// because of network errors.
return
}
if updateMsg . Update {
console . Println ( updateMsg )
}
}
}
// Sets new config directory.
setGlobalConfigPath ( configDir )
// Valid input arguments to main.
checkMainSyntax ( c )
// Generic Minio initialization to create/load config, prepare loggers, etc..
func minioInit ( ) {
// Sets new config directory.
setGlobalConfigPath ( globalConfigDir )
// Migrate any old version of config / state files to newer format.
migrate ( )
@ -197,23 +203,14 @@ func Main() {
// Init the error tracing module.
initError ( )
// Set global quiet flag.
globalQuiet = c . Bool ( "quiet" ) || c . GlobalBool ( "quiet" )
// Do not print update messages, if quiet flag is set.
if ! globalQuiet {
if c . Args ( ) . Get ( 0 ) != "update" {
updateMsg , _ , err := getReleaseUpdate ( minioUpdateStableURL , 1 * time . Second )
if err != nil {
// Ignore any errors during getReleaseUpdate(), possibly
// because of network errors.
return nil
}
if updateMsg . Update {
console . Println ( updateMsg )
}
}
}
// Main main for minio server.
func Main ( ) {
app := registerApp ( )
app . Before = func ( c * cli . Context ) error {
// Valid input arguments to main.
checkMainSyntax ( c )
return nil
}