tools: sync: create .config directory if it doesn't exist
This commit is contained in:
@@ -20,6 +20,9 @@ def in_source_tree():
|
||||
|
||||
|
||||
def create_sample_config():
|
||||
if not os.path.isdir('.config'):
|
||||
os.mkdir('.config')
|
||||
|
||||
config_file = open(config_filename, mode='w')
|
||||
data = {
|
||||
'targets': {
|
||||
@@ -39,7 +42,7 @@ def create_sample_config():
|
||||
def read_config():
|
||||
config_file = None
|
||||
try:
|
||||
config_file = open('sync.json')
|
||||
config_file = open(config_filename)
|
||||
except (OSError, FileNotFoundError):
|
||||
create_sample_config()
|
||||
print(help_str)
|
||||
|
||||
Reference in New Issue
Block a user