validate: Fix rendering destination directory path creation

We were ending up creating file:/some/path in cwd

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/187>
This commit is contained in:
Thibault Saunier 2020-05-04 17:59:28 -04:00
parent af3006dc12
commit e00ed70925

View file

@ -275,8 +275,11 @@ class LauncherConfig(Loggable):
self.dest = os.path.join(self.output_dir, "rendered")
self.privatedir = os.path.join(self.output_dir, "launcher-private")
if not os.path.exists(self.dest):
os.makedirs(self.dest)
destparsed = urllib.parse.urlparse(self.dest)
if destparsed.scheme == "" or destparsed.scheme == "file":
os.makedirs(destparsed.path, exist_ok=True)
if destparsed.scheme == "":
self.dest = path2url(self.dest)
if not os.path.exists(self.logsdir):
os.makedirs(self.logsdir)
if not os.path.exists(self.privatedir):
@ -287,9 +290,6 @@ class LauncherConfig(Loggable):
% self.redirect_logs, Colors.FAIL, True)
return False
if urllib.parse.urlparse(self.dest).scheme == "":
self.dest = path2url(self.dest)
if self.no_color:
utils.desactivate_colors()
if self.clone_dir is None: