Skip to content

Commit

Permalink
cmd/incus: Use .config/incus for config
Browse files Browse the repository at this point in the history
Signed-off-by: Stéphane Graber <[email protected]>
  • Loading branch information
stgraber committed Aug 16, 2023
1 parent 7ce7fe0 commit e9ae811
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/incus/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,14 +316,14 @@ func (c *cmdGlobal) PreRun(cmd *cobra.Command, args []string) error {
if os.Getenv("INCUS_CONF") != "" {
configDir = os.Getenv("INCUS_CONF")
} else if os.Getenv("HOME") != "" {
configDir = path.Join(os.Getenv("HOME"), ".config", "lxc")
configDir = path.Join(os.Getenv("HOME"), ".config", "incus")
} else {
user, err := user.Current()
if err != nil {
return err
}

configDir = path.Join(user.HomeDir, ".config", "lxc")
configDir = path.Join(user.HomeDir, ".config", "incus")
}

c.confPath = os.ExpandEnv(path.Join(configDir, "config.yml"))
Expand Down

0 comments on commit e9ae811

Please sign in to comment.