mirror of
https://github.com/passbolt/go-passbolt-cli.git
synced 2025-06-28 15:09:37 +00:00
automatically update config file permissions
This commit is contained in:
parent
7f3059db95
commit
bf4a0c8d4a
1 changed files with 6 additions and 2 deletions
|
@ -84,7 +84,11 @@ func initConfig() {
|
|||
viper.AutomaticEnv() // read in environment variables that match
|
||||
|
||||
// If a config file is found, read it in.
|
||||
if err := viper.ReadInConfig(); err == nil && viper.GetBool("debug") {
|
||||
if err := viper.ReadInConfig(); err == nil {
|
||||
if viper.GetBool("debug") {
|
||||
fmt.Fprintln(os.Stderr, "Using config file:", viper.ConfigFileUsed())
|
||||
}
|
||||
// update Config file Permissions
|
||||
os.Chmod(viper.ConfigFileUsed(), 0600)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue