From 79c30e5393e5b08547e1dc66661050b91dd6bcfe Mon Sep 17 00:00:00 2001 From: Max Wash Date: Sat, 6 May 2023 19:45:09 +0100 Subject: [PATCH] tools: sync: create .config directory if it doesn't exist --- tools/socks.sync | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/socks.sync b/tools/socks.sync index 454fed9..f2c5811 100755 --- a/tools/socks.sync +++ b/tools/socks.sync @@ -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)