From 1dc2acd1b1841c014997d3ad4af416b386407f29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=AD=90caitp=E2=AD=90?= Date: Fri, 8 Apr 2022 13:23:17 -0400 Subject: [PATCH] Expand variables in `working_dir` kind of a half-baked solution to #1 which will enable you to use `$folder/` to be relative to the first opened directory in the project --- Ninja.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Ninja.py b/Ninja.py index a271e5e..89e3714 100644 --- a/Ninja.py +++ b/Ninja.py @@ -1,7 +1,7 @@ import os import subprocess -from sublime import error_message, load_settings +from sublime import expand_variables, error_message, load_settings from sublime_plugin import WindowCommand @@ -38,7 +38,8 @@ def get(name): error_message(error_string) return value - working_dir = project_configuration.get("working_dir") + variables = self.window.extract_variables(); + working_dir = expand_variables(project_configuration.get("working_dir"), variables) if not os.path.exists(working_dir): error_string = ("Ninja: " "\"{0}\" does not exists").format(working_dir)