default_config.py migration helper
This commit is contained in:
parent
4421a3e9c2
commit
6717bbff70
1 changed files with 8 additions and 1 deletions
|
|
@ -36,9 +36,16 @@ def getConfigFilePath() -> str:
|
|||
path = os.path.join(getGlobalFolderPath(), "config.py")
|
||||
os.makedirs(os.path.dirname(path), exist_ok=True)
|
||||
|
||||
if not os.path.exists(path):
|
||||
with open(path, 'r') as f:
|
||||
existing_content = f.read()
|
||||
|
||||
if not os.path.exists(path) or 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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue