Skip to content

Commit

Permalink
fix and document env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
wkloucek committed Oct 19, 2021
1 parent df17067 commit 1b19e14
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ocis-pkg/config/defaults/paths.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func BaseDataPath() string {
// But how can we update the base path for every occurence with a flageset option?
// This is currenlty not possible and needs a new configuration concept
p := os.Getenv("OCIS_BASE_DATA_PATH")
if p == "" {
if p != "" {
return p
}

Expand Down
8 changes: 8 additions & 0 deletions ocis/pkg/flagset/flagset.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ import (
// RootWithConfig applies cfg to the root flagset
func RootWithConfig(cfg *config.Config) []cli.Flag {
return []cli.Flag{
&cli.StringFlag{
// this is just a dummy config flag do document the existence
// of this environment variable
// the environment variable itself is used in `ocis-pkg/config/defaults/paths.go`
Name: "ocis-base-data-path",
Usage: "Set the base path where oCIS stores data",
EnvVars: []string{"OCIS_BASE_DATA_PATH"},
},
&cli.StringFlag{
Name: "config-file",
Usage: "Load config file from a non standard location.",
Expand Down

0 comments on commit 1b19e14

Please sign in to comment.