Commit 38cf79e3 authored by Amir MOHAMMADI's avatar Amir MOHAMMADI

[config] don't save config on set

Fixes beat.editor#277
parent bcbaa84e
Pipeline #41543 passed with stage
in 4 minutes and 5 seconds
......@@ -114,7 +114,7 @@ class Configuration(object):
return dict((k, self.__data[k]) for k in self.__data if self.is_database_key(k))
def set(self, key, value, local=False):
def set(self, key, value):
"""Sets or resets a field in the configuration"""
if not self._is_valid_key(key):
......@@ -126,8 +126,6 @@ class Configuration(object):
elif key in DEFAULTS:
self.__data[key] = DEFAULTS[key]
self.save(local)
def save(self, local=False):
"""Saves contents to configuration file
......@@ -256,6 +254,7 @@ def set(ctx, args, local):
try:
for idx in range(0, len(args), 2):
ctx.meta["config"].set(args[idx], args[idx + 1], local)
ctx.meta["config"].set(args[idx], args[idx + 1])
ctx.meta["config"].save(local)
except Exception:
raise click.ClickException("Failed to change the configuration.")
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment