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():
|
def create_sample_config():
|
||||||
|
if not os.path.isdir('.config'):
|
||||||
|
os.mkdir('.config')
|
||||||
|
|
||||||
config_file = open(config_filename, mode='w')
|
config_file = open(config_filename, mode='w')
|
||||||
data = {
|
data = {
|
||||||
'targets': {
|
'targets': {
|
||||||
@@ -39,7 +42,7 @@ def create_sample_config():
|
|||||||
def read_config():
|
def read_config():
|
||||||
config_file = None
|
config_file = None
|
||||||
try:
|
try:
|
||||||
config_file = open('sync.json')
|
config_file = open(config_filename)
|
||||||
except (OSError, FileNotFoundError):
|
except (OSError, FileNotFoundError):
|
||||||
create_sample_config()
|
create_sample_config()
|
||||||
print(help_str)
|
print(help_str)
|
||||||
|
|||||||
Reference in New Issue
Block a user