storj/cmd/uplink/main.go
Egon Elbre 644df8dcdc private/version: minimal fix for tag-release.sh
Previous split to a storj.io/private repository broke tag-release.sh
script. This is the minimal temporary fix to make things work.

This links the build information to specified variables and sets them
inline. This approach, of course, is very fragile.

Change-Id: I73db2305e6c304146e5a14b13f1d917881a7455c
2020-04-01 13:46:45 +00:00

27 lines
767 B
Go

// Copyright (C) 2019 Storj Labs, Inc.
// See LICENSE for copying information.
package main
import (
"github.com/spf13/cobra"
"github.com/spf13/viper"
"storj.io/private/process"
"storj.io/storj/cmd/uplink/cmd"
_ "storj.io/storj/private/version" // This attaches version information during release builds.
)
func main() {
process.ExecWithCustomConfig(cmd.RootCmd, true, func(cmd *cobra.Command, vip *viper.Viper) error {
accessFlag := cmd.Flags().Lookup("access")
// try to load configuration because we may still need 'accesses' (for named access)
// field but error only if 'access' flag is not set
err := process.LoadConfig(cmd, vip)
if err != nil && (accessFlag == nil || accessFlag.Value.String() == "") {
return err
}
return nil
})
}