diff options
author | Nate Sesti <sestinj@gmail.com> | 2023-08-03 01:11:41 -0700 |
---|---|---|
committer | Nate Sesti <sestinj@gmail.com> | 2023-08-03 01:11:41 -0700 |
commit | bfd2f09cd6ebdc18e8162555a1859f0098b14cd3 (patch) | |
tree | 05b2bf8ac613b9af56c17e14179a87cceb80f8ea /continuedev | |
parent | 66b3a267c875f6d445032440de6a48982402f60e (diff) | |
download | sncontinue-bfd2f09cd6ebdc18e8162555a1859f0098b14cd3.tar.gz sncontinue-bfd2f09cd6ebdc18e8162555a1859f0098b14cd3.tar.bz2 sncontinue-bfd2f09cd6ebdc18e8162555a1859f0098b14cd3.zip |
small fixes to setup
Diffstat (limited to 'continuedev')
-rw-r--r-- | continuedev/src/continuedev/libs/util/paths.py | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/continuedev/src/continuedev/libs/util/paths.py b/continuedev/src/continuedev/libs/util/paths.py index 1e11898f..83a472ad 100644 --- a/continuedev/src/continuedev/libs/util/paths.py +++ b/continuedev/src/continuedev/libs/util/paths.py @@ -36,16 +36,20 @@ def getConfigFilePath() -> str: path = os.path.join(getGlobalFolderPath(), "config.py") os.makedirs(os.path.dirname(path), exist_ok=True) - with open(path, 'r') as f: - existing_content = f.read() - - if not os.path.exists(path) or existing_content.strip() == "": + if not os.path.exists(path): with open(path, 'w') as f: f.write(default_config) - elif " continuedev.core" in existing_content: - with open(path, 'w') as f: - f.write(existing_content.replace(" continuedev.", - " continuedev.src.continuedev.")) + else: + with open(path, 'r') as f: + existing_content = f.read() + + if existing_content.strip() == "": + with open(path, 'w') as f: + f.write(default_config) + elif " continuedev.core" in existing_content: + with open(path, 'w') as f: + f.write(existing_content.replace(" continuedev.", + " continuedev.src.continuedev.")) return path |