From 280e1fc29c0443660b3360644b448369b73e6178 Mon Sep 17 00:00:00 2001 From: Christopher Pickering Date: Fri, 21 Oct 2022 09:14:18 +0200 Subject: [PATCH] fix(windows+py3.9): fixed an issue on windows with py3.9 and stdin On windows python 3.9 the stdin path of - was "sometimes" recognized as the cwd, and sometimes as the system root. This update sets the cwd manually for paths of -. re https://github.com/monosans/djlint-vscode/issues/83 --- src/djlint/settings.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/djlint/settings.py b/src/djlint/settings.py index 5bb22ad..d6a34b3 100644 --- a/src/djlint/settings.py +++ b/src/djlint/settings.py @@ -220,7 +220,10 @@ class Config: self.lint = lint self.warn = warn - self.project_root = find_project_root(Path(src)) + if src == "-": + self.project_root = find_project_root(Path.cwd()) + else: + self.project_root = find_project_root(Path(src)) djlint_settings = load_project_settings(self.project_root, configuration)