Strip the path to userhome dir on Linux // Resolve #4173 Issue #4158

This commit is contained in:
Ivan Kravets
2022-02-08 17:21:13 +02:00
parent bb1e590222
commit 27400f66a9

View File

@ -78,9 +78,11 @@ def get_default_projects_dir():
except: # pylint: disable=bare-except
if not IS_MACOS:
try:
docs_dir = subprocess.check_output(
["xdg-user-dir", "DOCUMENTS"]
).decode("utf-8")
docs_dir = (
subprocess.check_output(["xdg-user-dir", "DOCUMENTS"])
.decode("utf-8")
.strip()
)
except FileNotFoundError: # command not found
pass
return os.path.join(docs_dir, "PlatformIO", "Projects")