Browse Source

Merge pull request #73 from alkuzad/patch-1

add_project problem on missing project_data
master
Randy Lai 4 years ago
committed by GitHub
parent
commit
a6f05a9451
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