mirror of
https://github.com/cupcakearmy/autorestic.git
synced 2026-04-02 11:55:23 +00:00
feat(Keygen&Config): Disabled encryption key generation and prevented SaveConfig from overwriting config files
This commit is contained in:
@@ -263,16 +263,19 @@ func AddFlagsToCommand(cmd *cobra.Command, backend bool) {
|
||||
}
|
||||
|
||||
func (c *Config) SaveConfig() error {
|
||||
file := viper.ConfigFileUsed()
|
||||
if err := CopyFile(file, file+".old"); err != nil {
|
||||
return err
|
||||
if true {
|
||||
return fmt.Errorf(`Not overwriting config; throwing error`);
|
||||
}
|
||||
colors.Secondary.Println("Saved a backup copy of your file next to the original.")
|
||||
// file := viper.ConfigFileUsed()
|
||||
// if err := CopyFile(file, file+".old"); err != nil {
|
||||
// return err
|
||||
// }
|
||||
// colors.Secondary.Println("Saved a backup copy of your file next to the original.")
|
||||
|
||||
viper.Set("backends", c.Backends)
|
||||
viper.Set("locations", c.Locations)
|
||||
// viper.Set("backends", c.Backends)
|
||||
// viper.Set("locations", c.Locations)
|
||||
|
||||
return viper.WriteConfig()
|
||||
// return viper.WriteConfig()
|
||||
}
|
||||
|
||||
func optionToString(option string) string {
|
||||
|
||||
Reference in New Issue
Block a user