From 2cd3dc844dd2ea38cfeda7a70973a192f69041b6 Mon Sep 17 00:00:00 2001 From: "Kyle D. McCormick" Date: Wed, 10 Apr 2024 08:52:27 -0400 Subject: [PATCH] fix: NameErrors in compile_sass.py Fixes three NameErrors which were introduced by the previous commit, leading to it being reverted. These NameErrors slipped through because the script was not tested on any themes that had zero SCSS overrides. --- scripts/compile_sass.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/compile_sass.py b/scripts/compile_sass.py index 97f800a34f..41a2d56b3b 100755 --- a/scripts/compile_sass.py +++ b/scripts/compile_sass.py @@ -259,7 +259,7 @@ def main( click.secho(f" Done.", fg="green") # For Sass files without explicit RTL versions, generate # an RTL version of the CSS using the rtlcss library. - for sass_path in glob.glob(str(source) + "/**/*.scss"): + for sass_path in glob.glob(str(source_root) + "/**/*.scss"): if Path(sass_path).name.startswith("_"): # Don't generate RTL CSS for partials continue @@ -270,7 +270,7 @@ def main( # Don't generate RTL CSS if there is an explicit Sass version for RTL continue click.echo(" Generating missing right-to-left CSS:") - source_css_file = sass_path.replace(str(source), str(dest)).replace( + source_css_file = sass_path.replace(str(source_root), str(target_root)).replace( ".scss", ".css" ) target_css_file = source_css_file.replace(".css", "-rtl.css")