Browse Source

add_project problem on missing project_data

Fix failure on adding new project when no project data is provided, just moved section under already existing ifology. Done same locally with resource opener and it fixes creating project.
master
Dawid Gosławski 4 years ago
committed by GitHub
parent
commit
e225d49347
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 19
      project_manager.py

19
project_manager.py

@ -296,17 +296,16 @@ class Manager:
pd = self.window.project_data()
pf = self.window.project_file_name()
pfile = os.path.join(self.primary_dir, '%s.sublime-project' % project)
if "folders" in pd:
for folder in pd["folders"]:
if "path" in folder:
path = folder["path"]
if sublime.platform() == "windows":
folder["path"] = expand_path(path, relative_to=pf)
else:
folder["path"] = pretty_path(
expand_path(path, relative_to=pf))
if pd:
if "folders" in pd:
for folder in pd["folders"]:
if "path" in folder:
path = folder["path"]
if sublime.platform() == "windows":
folder["path"] = expand_path(path, relative_to=pf)
else:
folder["path"] = pretty_path(
expand_path(path, relative_to=pf))
JsonFile(pfile).save(pd)
else:
JsonFile(pfile).save({})

Loading…
Cancel
Save